使用curl提交post请求到服务器被squid代理拦截

大城市里の小女人 提交于 2019-12-05 23:36:26

原文地址:http://dade.io/archives/25/

做网盘,上传文件到服务器时(服务器使用squid做代理),遇到下面的错误提示:

百思不得其解,查看PHP文档时,笔记中发现如下说明:

Sending a post file upload across a squid proxy, the request was rejected by the proxy. In the error page returned it provided among other possible causes:"Expect:" feature is being asked from a HTTP/one.zero. 
Solution: Add the option <?php curl_setopt($cl,CURLOPT_HTTPHEADER,array("Expect:")); ?>. This will remove the expect http header.

按照方案去掉“Expect:”的header头,OK!

文档还是挺有用的,希望能帮到各位!


易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!