Computer >> บทช่วยสอนคอมพิวเตอร์ >  >> การเขียนโปรแกรม >> PHP

CURL Context Options ใน PHP

บทนำ

CURL context options พร้อมใช้งานเมื่อ CURL extension ถูก compile ด้วยตัวเลือก configure --with-curlwrappers ด้านล่างคือรายการ CURL wrapper context options

Method Description
method HTTP method ที่ remote server รองรับ ค่าเริ่มต้นคือ GET
header Header เพิ่มเติมที่จะส่งระหว่าง request
user_agent ค่าที่จะส่งกับ User-Agent: header
content ข้อมูลเพิ่มเติมที่จะส่งหลัง headers ตัวเลือกนี้ไม่ใช้สำหรับ GET หรือ HEAD requests
proxy URI ระบุที่อยู่ของ proxy server
max_redirects จำนวน redirect สูงสุดที่จะ follow ค่าเริ่มต้น 20
curl_verify_ssl_host Verify host ค่าเริ่มต้น FALSE พร้อมใช้งานสำหรับ http และ ftp protocol wrappers
curl_verify_ssl_peer Require verification ของ SSL certificate ค่าเริ่มต้น FALSE พร้อมใช้งานสำหรับ http และ ftp protocol wrappers