最佳答案
我可以多次调用 curl_setopt
和 CURLOPT_HTTPHEADER
来设置多个头吗?
$url = 'http://www.example.com/';
$curlHandle = curl_init($url);
curl_setopt($curlHandle, CURLOPT_HTTPHEADER, array('Content-type: application/xml'));
curl_setopt($curlHandle, CURLOPT_HTTPHEADER, array('Authorization: gfhjui'));
$execResult = curl_exec($curlHandle);