HTTP Headers
Content Length
The HTTP Content-Length
header specifies the size, in bytes, of the message body being transmitted to the recipient.
Syntax
Content-Length: <length>
Directives
The length is measured in octets.
How to Modify Header using Requestly
Requestly is a powerful Chrome extension that allows you to modify HTTP headers, including the Content-Length header. This is especially useful when you want to test how your server or application behaves with different payload sizes or if you need to simulate requests with incorrect content length during development or debugging. Steps to Modify the Content-Length Header:
- Install and open the Requestly Chrome extension. You can find it on the Chrome Web Store.
- Create a new rule: Click on “Create Rule” and choose “Modify Headers” from the list of available rule types.
- Add a new header modification:
- Under “Action”, select “Add” or “Override”.
- In the “Header Name” field, enter Content-Length.
- In the “Header Value” field, enter the desired content length value (e.g., 123).
- Set the URL condition: Specify the URL or pattern where this header change should apply (e.g., https://your-api.com/*).
- Save the rule.
Once set up, Requestly will inject the modified Content-Length header into all matching requests, allowing you to simulate different payload sizes or test how your server handles incorrect or unexpected content lengths.
Table of Contents
- No headings found.