Sunday, July 12, 2009

How to modify http headers in Internet Explorer

When developing for the web, you may want to simulate various HTTP Header values for your application. This is easy in Firefox - there are a number of plugins that allow you to do this like Modify Headers.

However for IE6 it is more difficult. The best solution I have found is this one:

- Download Fiddler.
- Open the 'Customize Rules' window (Rules->Customize Rules...)
- find this function: static function OnBeforeRequest(oSession: Session)
- inside this function, add the header values that you would like to add, in this format:

oSession.oRequest["headerName"] = "headerValue";

-save


VoilĂ ! Internet Explorer will now accept your custom header values. You will probably need to clear your browser cookies before it takes effect.

4 comments:

vlad said...

its great. working for me, thanks

KMZack said...

where exactly to add that function? i got an error after save it

Daniel Alexiuc said...

Add it inside the function named "OnBeforeRequest(oSession: Session)".

Try adding it on the line immediately following that one.

KMZack said...

Shame on me i am still gor an error after save it.