您的位置:首页 > 理论基础 > 计算机网络

如何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
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
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: