15

I need to be able to modify the HTTP headers for Internet Explorer for testing purposes.

Basically, I want to achieve the exact same thing that the Modify Headers plugin for Firefox does.

Daniel Alexiuc
  • 13,078
  • 9
  • 58
  • 73

4 Answers4

22

To modify the header with Fiddler:

1- Open Fiddler Web Debugger and in the menu toolbar go to Rules->Customize Rules... (shortcut is Ctrl + R). It opens the CustomRules.js file. Fiddler may suggest you to download Fiddler ScriptEditor but you can edit it with any text editor (I use notepad++)

2- Find OnBeforeRequest(oSession: Session) in the script file.

3- You can add a new header by adding oSession.oRequest["NewHeaderName"] = "New header value"; to OnBeforeRequest function. Also, to remove a header, use oSession.oResponse.headers.Remove("HeaderName"); function.

For more information see this link

Arashsoft
  • 2,749
  • 5
  • 35
  • 58
14

You could install Fiddler and modify request headers with the CustomRules.js file

PatrikAkerstrand
  • 45,315
  • 11
  • 79
  • 94
  • 2
    The site has changed. Does Fiddler still have something to modify request headers? It is not obvious from the Fiddler application and I cannot find anything involving a CustomRules.js file. – Joey Dec 10 '15 at 22:05
  • @Joey Install Fiddler and install its [Syntax-Highlighting Add-Ons](http://www.telerik.com/fiddler/add-ons) then restart Fiddler and go to `Rules > Customize Rules...` then edit the file [as per the examples](http://docs.telerik.com/fiddler/KnowledgeBase/FiddlerScript/ModifyRequestOrResponse) and press `Save Script`. Now make a request and your new header(s) should show up. – Ian Kemp Oct 06 '16 at 10:24
3

You could use Charles Proxy to do all sorts of header rewriting. It's a great tool.

Marc Novakowski
  • 44,628
  • 11
  • 58
  • 63
  • Thanks! This also worked great, and is much nicer to use than Fiddler. Costs money though. – Daniel Alexiuc Jul 01 '09 at 21:54
  • 1
    It still works without registration, just with nag screens and I think auto-shutdown after a period of time. However, once you start using this tool you'll quickly realize it's well worth the small price. – Marc Novakowski Jul 02 '09 at 16:29
  • 1
    If you actually think it's "much nicer", I'd very much like to hear why. Please email me using the Help / Send Feedback link in Fiddler. – EricLaw Jul 27 '09 at 22:20
3

Proxomitron has the ability to modify headers for IE and its free

Gautam
  • 31
  • 1