{"id":1069,"date":"2014-03-09T15:26:15","date_gmt":"2014-03-09T15:26:15","guid":{"rendered":"http:\/\/emtunc.org\/blog\/?p=1069"},"modified":"2017-02-24T15:29:54","modified_gmt":"2017-02-24T15:29:54","slug":"modifying-all-request-headers-in-fiddler","status":"publish","type":"post","link":"https:\/\/emtunc.org\/blog\/03\/2014\/modifying-all-request-headers-in-fiddler\/","title":{"rendered":"Modifying All Request Headers in Fiddler"},"content":{"rendered":"<p>This quick guide will show you how you can add and modify headers in Fiddler and them to all requests.<\/p>\n<p>There will be times where you will need to test performance or functionality of web apps which may require the modification of request headers &#8211; for example, if you were to move to a shared hosting environment and want to test the functionality and performance of the new host without changing DNS records, you will need to modify the HOST header otherwise the host will not know which site you want to visit.<\/p>\n<p><!--more--><\/p>\n<ol>\n<li>Firstly, launch Fiddler!<\/li>\n<li>Click the <em>Rules<\/em> menu item and <em>Customize Rules<\/em> (or CTRL + R)<\/li>\n<li>Do a find for <em>onBeforeRequest<\/em><\/li>\n<li>This is where you will put the code to add\/modify a header<\/li>\n<\/ol>\n<p>To add or modify a header:<\/p>\n<pre class=\"lang:js decode:true\">oSession.oRequest[\"HeaderName\"] = \"New header value\";<\/pre>\n<p>So if you want to modify the HOST header so that it looks like you are requesting example.org, your custom rules file will look like this:<\/p>\n<pre class=\"lang:js decode:true  \">oSession.oRequest[\"Host\"] = \"example.org\";<\/pre>\n<p>Source: You can do a lot more with the custom rules file &#8211; see here for more information: <a title=\"Fiddler - Modifying a Request or Response\" href=\"http:\/\/docs.telerik.com\/fiddler\/knowledgebase\/fiddlerscript\/modifyrequestorresponse\" target=\"_blank\">http:\/\/docs.telerik.com\/fiddler\/knowledgebase\/fiddlerscript\/modifyrequestorresponse<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>This quick guide will show you how you can add and modify headers in Fiddler and them to all requests. There will be times where you will need to test performance or functionality of web apps which may require the modification of request headers &#8211; for example, if you were to move to a shared [&hellip;]<\/p>\n","protected":false},"author":32,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"footnotes":""},"categories":[1],"tags":[101,133],"class_list":["post-1069","post","type-post","status-publish","format-standard","hentry","category-tech","tag-fiddler","tag-headers"],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p1trTO-hf","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/emtunc.org\/blog\/wp-json\/wp\/v2\/posts\/1069","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/emtunc.org\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/emtunc.org\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/emtunc.org\/blog\/wp-json\/wp\/v2\/users\/32"}],"replies":[{"embeddable":true,"href":"https:\/\/emtunc.org\/blog\/wp-json\/wp\/v2\/comments?post=1069"}],"version-history":[{"count":8,"href":"https:\/\/emtunc.org\/blog\/wp-json\/wp\/v2\/posts\/1069\/revisions"}],"predecessor-version":[{"id":2488,"href":"https:\/\/emtunc.org\/blog\/wp-json\/wp\/v2\/posts\/1069\/revisions\/2488"}],"wp:attachment":[{"href":"https:\/\/emtunc.org\/blog\/wp-json\/wp\/v2\/media?parent=1069"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/emtunc.org\/blog\/wp-json\/wp\/v2\/categories?post=1069"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/emtunc.org\/blog\/wp-json\/wp\/v2\/tags?post=1069"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}