如何hacke浏览器HTTP request的header

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 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

转载于:https://www.cnblogs.com/rsail/archive/2012/09/08/2676271.html

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值