HTTP headers | Content-Range

The Content-Range HTTP header is a response header that indicates where a partial message belongs in a full body massage. This header is sent with a partial entity-body to specify where in the full entity-body the partial body should be applied.

Syntax:

Content-Range: <unit> <range-start>-<range-end>/<size>
Content-Range: <unit> <range-start>-<range-end>/*
Content-Range: <unit> */<size>

Directives:

  • <unit>: This specifies the unit of content range. This value is usually in bytes.
  • <range-start>: An integer that specifies the beginning of the requested range in a given unit.
  • <range-end>: An integer that specifies the ending of the requested range in a given unit.
  • <size>: This specifies the total size of the document. The ‘*’ is used when the value is unknown.

Examples:

Content-Range: bytes 500-1000/65989

It specifies the unit of the range as bytes and states the range-start as 500 bytes while the range-end as 1000 bytes. The total size of the document is 65989 bytes.

Content-Range: bytes 50-1000/*

It specifies the unit of the range as bytes and states the range-start as 50 bytes while the range-end as 1000 bytes. The total size of the document is unknown.

Supported Browsers The following browsers are compatible with HTTP Content-Range:

  • Google Chrome
  • Internet Explorer
  • Opera
  • Firefox
  • Safari
My Personal Notes arrow_drop_up

Check out this Author's contributed articles.

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.


Article Tags :

Be the First to upvote.


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.