🎉 Requestly joins BrowserStack to build the future of application testing. Read more

HTTP Headers

Accept Ranges

HTTP Header

The HTTP Accept-Ranges response header is used by the server to indicate its support for range requests. This feature allows clients to request specific parts or multiple parts of a resource rather than the entire resource at once.
The value of this header specifies the unit used to define a range, such as bytes or other measures.

For example, when a server responds with an Accept-Ranges header, it signifies that the server can resume an interrupted download, enabling clients to continue from where they left off instead of restarting the transfer from the beginning.

Syntax

http
Accept-Ranges: <range-unit>
Accept-Ranges: none

Directives

<range-unit>

The range unit that the server supports, although bytes is the only range unit formally defined by RFC 7233. Range units are registered in the HTTP Range Unit Registry.

none

No range unit is supported. This is equivalent to omitting the header and is, therefore, rarely used. This value was used in legacy browsers to disable or remove the pause buttons in the download manager if servers had no support for range requests.

Example

Accept-Ranges: bytes

How to Modify Header using Requestly

Requestly is a powerful Chrome extension that allows you to modify HTTP headers, including the Accept header. This is especially useful for testing how your application responds to different media types during development or debugging. Steps to Modify the Accept Header:

  1. Install and open the Requestly Chrome extension. You can find it on the Chrome Web Store.
  2. Create a new rule: Click on “Create Rule” and choose “Modify Headers” from the list of available rule types.
  3. Add a new header modification:
    • Under “Action”, select “Add” or “Override”.
    • In the “Header Name” field, enter Accept.
    • In the “Header Value” field, enter your preferred media type (e.g., text/html).
  4. Set the URL condition: Specify the URL or pattern where this header change should apply (e.g., https://your-api.com/*).
  5. Save the rule.

Once set up, Requestly will inject the Accept: text/html header into all matching requests, allowing you to simulate different client behaviors and test content negotiation on your server.

You might need to modify the Accept header to see how your server handles requests for different content types. This helps ensure your application works correctly with various formats like JSON, HTML, or XML during development and troubleshooting.