Range Header

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.

Syntax

Range: <unit>=<range-start>-<range-end>

In the syntax <unit> refers to the unit of range which should be 'bytes'. <range-start> and <range-end> refer to the beginning and ending byte positions, respectively.

Directives

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.

Examples

An example of the Range header would be:

Range: bytes=2000-4000

This asks for the content from the byte position 2000 through 4000.

Browser Compatibility

Browser Compatibility
Chrome Supported
Firefox Supported
Safari Supported
Opera Supported
Edge Supported

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:

  1. Install and open the ModHeader extension from the Chrome store.
  2. Click on 'Add', followed by 'Request header'.
  3. 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".
  4. 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.