如何hacke浏览器HTTP request的header
2012-09-08 09:28
211 查看
1,参考文章:http://stackoverflow.com/questions/7097502/view-and-set-http-headers-for-safari-chrome
(1)这个是chrome上的方案
The (currently experimental) WebRequest API lets you do view and modify headers: http://code.google.com/chrome/extensions/trunk/webRequest.html
It's pretty easy to view headers using
To edit headers, you'll need to block the request. This sample (from the docs linked to above) removes the User-Agent header from all requests:
I would use Fiddler as my debugging proxy and set the header there. See the "Add a request header" of the FiddlerScript CookBook. This same solution would work with any browser.
Fiddler is a Web Debugging Proxy which logs all HTTP(S) traffic between your computer and the Internet. Fiddler allows you to inspect all HTTP(S) traffic, set breakpoints, and "fiddle" with incoming or outgoing data. Fiddler includes a powerful event-based scripting subsystem, and can be extended using any .NET language.
(1)这个是chrome上的方案
The (currently experimental) WebRequest API lets you do view and modify headers: http://code.google.com/chrome/extensions/trunk/webRequest.html
It's pretty easy to view headers using
onSendHeaders.
To edit headers, you'll need to block the request. This sample (from the docs linked to above) removes the User-Agent header from all requests:
chrome.experimental.webRequest.onBeforeSendHeaders.addListener( function(details) { delete details.requestHeaders['User-Agent']; return {requestHeaders: details.requestHeaders}; }, {}, ["blocking"]); (2)这个是local的终极方案
I would use Fiddler as my debugging proxy and set the header there. See the "Add a request header" of the FiddlerScript CookBook. This same solution would work with any browser.
Fiddler is a Web Debugging Proxy which logs all HTTP(S) traffic between your computer and the Internet. Fiddler allows you to inspect all HTTP(S) traffic, set breakpoints, and "fiddle" with incoming or outgoing data. Fiddler includes a powerful event-based scripting subsystem, and can be extended using any .NET language.
(3)MAC的 I actually found an app called GrpahicalHttpClient in the Mac AppStore that's a lot easier and more enjoyable to use. (4)FireFox的 Modify Headers on the FireFox browser
相关文章推荐
- Python爬虫通过替换http request header来欺骗浏览器实现登录功能
- 如何在HTML页面中创建兼容不同浏览器的XMLHttpRequest对象
- Python爬虫通过替换http request header来欺骗浏览器实现登录
- Java如何从HttpServletRequest中读取HTTP请求的body
- AJAX不同浏览器的XMLHttpRequest对象生成
- HttpWebRequest 和 浏览器打开的区别
- 如何截获浏览器的http请求——几款不错的http抓包工具
- PHP中截取HTTPRequest请求的Header,并使用explode函数切割字符串维数组
- Java如何从HttpServletRequest中读取HTTP请求的body
- 如何防止XMLHttpRequest对象传回的中文数据中出现乱码
- 如何解决XMLHttpRequest cannot load file~~~~~~~Origin 'null' is therefore not allowed access
- XMLHttpRequest与浏览器之别
- Failed to load http://localhost:8080/team.php: Request header field x-jwt-header is not allowed by Access-Control-Allow-Headers in preflight response.
- [dotNET]使用HttpWebRequest请求远端服务器时如何加载SSL证书
- HTTP基础(一):如何使用浏览器network查看请求和响应的信息
- 关于loadrunner使用web_add_header添加HTTP信息头(比如Content-Type,token等)和使用web_custom_request()提交json数据
- 如何用HttpWebRequest下载gzip, deflate压缩的页面
- 如何让nginx修改Response HTTP Header中的server的值
- 如何在ajax请求中设置特殊的RequestHeader
- 如何用HttpWebRequest下载gzip, deflate压缩的页面