【发布时间】:2014-04-29 07:50:42
【问题描述】:
由于防火墙审核,请求必须始终具有“UserAgent”和“Accept”标头。
我试过了:
$soapclient = new soapclient('http://www.soap.com/soap.php?wsdl',
array('stream_context' => stream_context_create(
array(
'http'=> array(
'user_agent' => 'PHP/SOAP',
'accept' => 'application/xml')
)
)
)
);
服务器soap收到的请求
GET /soap.php?wsdl HTTP/1.1
Host: www.soap.com
User-Agent: PHP/SOAP
Connection: close
预期结果
GET /soap.php?wsdl HTTP/1.1
Host: www.soap.com
Accept application/xml
User-Agent: PHP/SOAP
Connection: close
为什么没有发送“接受”? “用户代理”有效!
【问题讨论】:
标签: php soap http-headers