curl命令返回HTTP / 1.1 406不接受错误
问题描述:
我使用下面的命令行卷曲的知道,如果我的网站支持COM pressing和缓存
I am using below command line curl for knowing if my site supports compressing and caching
卷曲--head --com preSS http://www.mysite.com
返回以下结果。
Http://1.1 406 Not Acceptable
Date: Wed, 28 Dec 2011 07:41:32 GMT
Server: Apache
Content-Type: text/html; charset-iso-8859-1
你怎么看待这个问题呢?
谢谢
what do you think about the problem? Thanks
答
在某些情况下,我有,伪造代理解决了这个问题,通过使用:
In some case I had, faking the agent solved this problem, by using:
curl -A "Mozilla/4.0"
同样使用 libcurl的C-API
:
curl_easy_setopt(curl, CURLOPT_USERAGENT, "Mozilla/4.0");