curl command return http/1.1 406 not acceptable error curl command return http/1.1 406 not acceptable error curl curl

curl command return http/1.1 406 not acceptable error


In some case I had, faking the agent solved this problem, by using:

curl -A "Mozilla/4.0"

Similarly using libcurl C-API:

curl_easy_setopt(curl, CURLOPT_USERAGENT, "Mozilla/4.0");


From the HTTP/1.1 standard:

The resource identified by the request is only capable of generating response entities which have content characteristics not acceptable according to the accept headers sent in the request.

Unless it was a HEAD request, the response SHOULD include an entity containing a list of available entity characteristics and location(s) from which the user or user agent can choose the one most appropriate.

So drop the --head and you should see whats wrong.

The 406 may just be what is proving you right - the server doesn't support compression. :)