HTTP headers | Content-Length

HTTP headers are used to pass additional information in HTTP request or HTTP response. HTTP Content-Length entity-header is used to indicate the size of entity-body in decimal no of octets i.e. bytes and sent it to the recipient. It is a forbidden header name. Basically it is the number of bytes of data in the body of the request or response. The body comes after the blank line below the headers.

Syntax:

Content-Length: <length>

Directive: This headers accepts a single directive mentioned above and described below:

  • Length: It defines the length of entity-body in decimal no of octets or say bytes.

Example:

content-length: 6553
content-length: 54138

To check this Content-Length in action go to Inspect Element -> Network check the request header for Content-Length like below, Content-Length is highlighted.

Supported Browsers: The browsers compatible with HTTP headers Content-length are listed below:

  • Google Chrome
  • Internet Explorer
  • Firefox
  • Safari
  • Opera
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.