我试图下载此文件:http://www.macupdate.com/download/49646/privatus.dmg
它为我提供了302个http代码,因此,我获得了位置标题,并使用了一个新地址:http://sweetpproductions.com/products/privatus/Privatus.dmg
但是新链接为我提供了406个带有此标题的http代码:
"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"
和身体:
<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>
我尝试将Accept标头设置为Content-Type和Accept-Date to Date,但它没有帮助。返回代码始终为406.但浏览器可以下载此文件。那么,如何省略此错误并下载文件?
答案 0 :(得分:0)
我不确定您发送的确切标头是什么。可能是您可以尝试添加用户代理(某些已注册设备)或更好的只是比较任何浏览器(如chrome)的请求标头与您的应用程序的请求标头。