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

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

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

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

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!ide

文档仍是挺有用的,但愿能帮到各位!post

相关文章
相关标签/搜索