Table of Content
The Range header is a HTTP request header that is applicable when you need partial piece(s) or a range of the requested content or resource from the server. The substantial purpose of the Range header is reducing the data needed to fulfill the HTTP request where the byte serving is efficiently facilitated. It is particularly beneficial in streaming video and audio files where buffers and stability can be efficiently managed.
In the syntax
<unit> refers to the unit of range which should be 'bytes'.
<range-end> refer to the beginning and ending byte positions, respectively.
The Range header accepts several directives, including bytes, which refer to the range unit in bytes, and date, which specifies a range in time for date-time-based media.
An example of the Range header would be:
This asks for the content from the byte position 2000 through 4000.
How to modify Range header
ModHeader is a Chrome extension that permits altering HTTP request and response headers. To modify the Range header using ModHeader, follow these steps:
- Install and open the ModHeader extension from the Chrome store.
- Click on 'Add', followed by 'Request header'.
- Type "Range" in the input box for header name, and in the input box for header value, type your desired value, e.g, "bytes=2000-4000".
- Finally, activate ModHeader by toggling the switch on the top right corner of the extension's dialogue box.
With these steps, each time you send a request to a server, it will include the modified Range header. This is particularly useful when testing server behavior with different byte ranges, or optimizing media loading in a web application.