CURLOPT_HTTPHEADER

使用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! 文档还是挺有用的,希望能帮到各位! 来源: oschina 链接: https://my.oschina.net/u/197193/blog/169930