Search code examples
httphttp-headershttp-status-codesdownloadhttp-status-code-406

How to omit 406 http error?


I'm trying to download this file: http://www.macupdate.com/download/49646/privatus.dmg

It gives me 302 http code, so, I get Location Header and go by a new address: http://sweetpproductions.com/products/privatus/Privatus.dmg

But new link gives me 406 http code with this headers:

"Date" "Mon, 27 Oct 2014 14:24:32 GMT"
"Content-Type" "text/html; charset=iso-8859-1"
"Transfer-Encoding" "chunked"
"Connection" "keep-alive"
"Set-Cookie" "__cfduid=da76029364799a83265f7f215bbddef491414419872061; expires=Mon, 23-Dec-2019 23:50:00 GMT; path=/; domain=.sweetpproductions.com; HttpOnly"
"Server" "cloudflare-nginx"
"CF-RAY" "17ff8ec8633f0893-FRA"

and with body:

<head><title>Not Acceptable!</title></head><body><h1>Not Acceptable!</h1><p>An appropriate representation of the requested resource could not be found on this server. This error was generated by Mod_Security.</p></body></html>

I tried to set Accept header to Content-Type and Accept-Date to Date but it doesn't help. Returning code is always 406. But browsers can download this file. So, how to omit this error and download file?


Solution

  • I am not sure what are the exact headers you are sending. May be you can try adding user-agent(of some registered device) or better just compare the request headers of any browser(like chrome) with those of your application.