How to modify HTTP request headers
Table of Content
- Add or modify a request header
- Remove an existing request header
- Test the request header modifications
- Disable / enable a request header modification
- Remove a request header modification
- Append to an existing request header
- Why is my request header in lower-case?
- Why is my request header not modified?
Add or modify a request header
- Open ModHeader extension.
- Click on the button at the top and select Request Header.
- Add the request header to modify on the Name and Value columns
Remove an existing request header
- To remove a request header from being sent, set the Name column only. If an existing header matches the name, it will be removed.
- If you instead wish to send an empty header, click on the "Empty header: remove" chip to change the behavior to "Empty header: send empty value". In this mode, an empty request header will be sent instead.
Test the request header modifications
You can check the inspect the network request in the developer console in your browser. Alternatively, you can also use our headers tool to check if your modifications are being applied.
Disable / enable a request header modification
- To disable a request header modification, simply uncheck the checkbox on the left side of the row.
- To reenable a request header modification, simply check the checkbox again.
- To disable / enable all request header modifications, uncheck / check the checkbox next the Request Headers title.
Remove a request header modification
- Simply click on the X button on the right side of the row to delete.
Append to an existing request header
- By default, the modification will override the value of an existing request header. To change this behavior, you can select the button on the right side of the row, then select Append instead of override. In this mode, the modification will append the value in the row to the existing header.
- In some scenarios, you may want to add a comma before appending the value. To do this, simply click on the append value chip to change the behavior to append with comma separated.
- To get back to the original override mode, simply click on the "X" button on the chip to remove the append mode.
Why is my request header in lower-case?
- If you are using Chromium-based browsers, you may notice that your newly added header got its name transformed to lowercase. This is done by the browser, and unfortunately ModHeader can't do anything about it.
- According to HTTP specification though, header names are case-insensitive, so the server should handle the request correctly regardless of the case.
Why is my request header not modified?
Check if the request is cached. A request that does not go through the network cannot be modified. In Chrome, you will typically see a message like this for cached request: "Provisional headers are shown. Disable cache to see full headers."