0
cURL发送的头之间有什么区别?cURL头之间的区别
$header="POST /cgi-bin/webscr HTTP/1.1\r\n";
$header .="Content-Type: application/x-www-form-urlencoded\r\n";
$header .="Host: www.paypal.com\r\n";
$header .="Connection: close\r\n\r\n";
而且
$header = array ('POST /cgi-bin/webscr HTTP/1.1', 'Content-Type: application/x-www-form-urlencoded', 'Host: www.paypal.com', 'Connection: close');
用于
curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
我可以使用两种方法为卷曲设置了头?谢谢
该文档(http://php.net/manual/en/function.curl-setopt.php)没有提到第一个解决方案,我会坚持第二个解决方案。 –
您说得对,我也使用第二种解决方案,但我从PayPal收到一封电子邮件以升级到HTTP 1.1,他们提到了第一个解决方案。标题必须是对象或数组。可以使用第二种解决方案记住第一个解决方案中的标题值? –
这是PayPal,忽略了他们对代码所说的一切。他们的网站非常缓慢。 –