先列出 hessianphp 的错误提示:
的头域!2)libcurl 发送大于1024字节数据时启用“Expect:100-continue‘特性:
1. 发送一个请求,包含一个 "Expect: 100-continue" 头域,询问 Server 是否愿意接收数据; 2. 接收到 Server 返回的 100-continue 应答以后,才把数据 POST 给 Server;
立即学习“PHP免费学习笔记(深入)”;
zxgfa 在 2012年补充说:(郑昀注1:lighttpd 1.4 版本有此严重问题,于1.5版本修复。 郑昀注2:Resin 于 3.0.5 版本增加了对 Expect: 100-continue 的支持。)
立即学习“PHP免费学习笔记(深入)”;
3)PHP Curl-library 可以主动封禁此特性: 有人在 PHP手册::curl_setopt 下留言说: PHP curl 遵从 libcurl 的特性。由于不是所有 web servers 都支持这个特性,所以会产生各种各样的错误。如果你遇到了,可以用下面的命令封禁"Expect"头域:<span class="html"><span class="default"> <?php </span></span></span>
<span class="html"><span class="default"> curl_setopt</span><span class="keyword">(</span><span class="default">$ch</span><span class="keyword">,<span class="Apple-converted-space"> </span></span><span class="default">CURLOPT_HTTPHEADER</span><span class="keyword">, array(</span><span class="string">'Expect:'</span><span class="keyword">));<br></span><span class="default"> ?><br></span><span pooy><br></span></span>
图1 You can convince PHP's curl backend to stop doing the 100-continue-thing by setting an explicit request header
,hessian 报错“CURL transport error: transfer closed with outstanding read data remaining”。解决: 修改hessian中 CURLOPT 项: CURLOPT_HTTPHEADER => array("Content-Type: application/binary") 改为 CURLOPT_HTTPHEADER => array("Content-Type: application/binary","Expect:")
360度后空翻开球:
360无死角:
PHP怎么学习?PHP怎么入门?PHP在哪学?PHP怎么学才快?不用担心,这里为大家提供了PHP速学教程(入门到精通),有需要的小伙伴保存下载就能学习啦!
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号