Tob*_*lis 5 php email curl exchangewebservices php-curl
I have a problem between CURL and PHP. I tried to connect to an Exchange 2010 Server via EWS. The connection to the server works fine in command line using CURL but not with PHP Curl extension.
I attached an image with the debug information. On the left you see command line output, on the right PHP verbose output. When the PHP Curl Extension throws an error "Connection closure while negotiation auth (HTTP 1.0?)" the command line continues with a third HTTP request with results in an HTTP/1.1 302 Found:
Some additional information:
Does anybody know why the PHP Curl Extension closes the connection before the third request? Is this a bug of the extension, can I use a constant of PHP Curl to avoid that or is there another solution?
我通过使用SoapClient和 Microsoft Exchange 2010 Server遇到过这样的问题 ,技巧是将标头数组选项“Expect: 100-continue”更改 为“Expect: 200-ok ”
protected function buildHeaders($action)
{
return array(
'Method: POST',
'Connection: Keep-Alive',
'User-Agent: PHP-SOAP-CURL',
'Content-Type: text/xml; charset=utf-8',
"SOAPAction: \"$action\"",
'Expect: 200-ok',
);
}
Run Code Online (Sandbox Code Playgroud)
100(继续)状态代码表示请求的初始部分已被接收并且尚未被服务器拒绝。
200(OK)状态码表示请求已成功。成功的含义因 HTTP 方法而异。
您还可以查看HTTP 状态代码
我希望这能有所帮助