Chrome – how to add custom http request headers

At times we may need to add custom headers to a request for debugging purpose. e.g. You may want to display debugging messages when specific header is present in request (e.g. debug with value 1). This can be done using Modify header chrome plugin. Here are quick steps:

  1. Install the Modify header plugin in Chrome browser.
  2. Once installed, look for the plugin icon in Chrome toolbar and click on it. Select Request headers and enter “debug” with value 1 (just using these values for the sake of this tutorial). Select URL pattern and enter the desired domain pattaern (e.g. *://infoheap.com/). You can also enter multiple patterns. In that case headers will be sent to url matching any pattern.
    chrome-modifiy-header-form
  3. Open Chrome developer tools and load a url which matches with above pattern. You should be able to see custom header in request headers as shown below:
    chrome-view-modified-headers-after-adding-custom-header
  4. Load a url which does not match with above pattern. Now our custom header field should not be present in headers.
Share this article: share on Google+ share on facebook share on linkedin tweet this submit to reddit

Comments

Click here to write/view comments