Modify Headers in HTTP(s) Requests and Responses

Modify headers using requestly

To modify headers, select Modify Headers Rule.

Select modify headers from the rule selector

Select type of headers to modify- Request/Response

  • A new header can be added.
  • Existing header can be removed.
  • Existing header’s value can be overridden.
Modify Headers rule editor

When modifying headers is helpful?

Open websites in iframe for testing

Sometimes you need to open pages in iframe, but response headers like X-Frame-Options and Content-Security-Policy does not allow it to prevent clickjacking. Using Requestly, you can modify this header to allow the website to be opened in iframe.

Remove Content-Security-Policy

Content-Security-Policy response header is added to the website to prevent injection of external scripts but sometimes while testing it is required to inject scripts. Requestly can be used to remove CSP response header.

Access Kubernetes dashboard by modifying Authorization header

You can access dashboard, you simply need to pass Authorization: Bearer <token> in every request to Dashboard. Requestly enables you to quickly modify the header.

Add custom request headers

Custom request headers can be added to manage features. Generally x-custom-header convention is followed.

Change Content-Type of the requested resource.

Test sites in production

To test sites in production, one can use local backend with the production site but here the browser can give CORS errors.

  • Access-Control-Allow-Origin
  • Access-Control-Allow-Methods
  • Access-Control-Allow-Headers
  • Access-Control-Allow-Credentials

Modify Headers in Safari

Download the Requestly desktop app to modify headers in safari and other apps.

Modify Headers in your Android app

Download Request Android Debugger to modify headers in your android app.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Requestly

Requestly

Setup redirects, modify headers, switch hosts, insert user scripts and much more. Install it on Chrome & Firefox and join our family of more than 100,000 devs!