Content-Length - HTTP headers Last Updated : 25 Sep, 2024 Comments Improve Suggest changes Like Article Like Report HTTP headers are used to transmit additional information in an HTTP request or response. One such important header is the Content-Length header, which is responsible for indicating the size of the entity-body, measured in bytes (octets). This information is used by the recipient to know the exact length of the body content that follows the headers.What is the Content-Length Header?The Content-Length header defines the size of the HTTP message body (in bytes) sent to the recipient. This header is especially useful in cases where the recipient needs to know how much data to expect. The size is defined in decimal format.The Content-Length header is considered a forbidden header name, meaning you cannot modify or set it programmatically in certain environments, such as using JavaScript within browsers.Syntax:Content-Length: <length>Directive: This header 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: 6553content-length: 54138How to Check Content-Length in ActionRight-click on the page and select Inspect or use the keyboard shortcut Ctrl + Shift + I (Windows) or Cmd + Option + I (Mac).Go to the Network tab in the developer tools.Reload the page or perform an action that sends a request.Click on the request and examine the Headers tab to find the Content-Length header under "Response Headers" or "Request Headers." Comment More infoAdvertise with us Next Article HTTP headers | Content-Type A aman neekhara Follow Improve Article Tags : Computer Networks HTTP-headers Similar Reads 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 1 min read HTTP headers | Content-Language HTTP headers are used to provide additional information in HTTP request and HTTP response. HTTP headers Content-Language is used to define, which language speaker document is intended to. It doesn't define the language of the document. In case this header is not specified, it is assumed that the doc 1 min read HTTP headers | Content-Type The Content-Type header is used to indicate the media type of the resource. The media type is a string sent along with the file indicating the format of the file. For example, for image file its media type will be like image/png or image/jpg, etc. In response, it tells about the type of returned con 3 min read HTTP headers | Content-Type The Content-Type header is used to indicate the media type of the resource. The media type is a string sent along with the file indicating the format of the file. For example, for image file its media type will be like image/png or image/jpg, etc. In response, it tells about the type of returned con 3 min read HTTP headers | Content-Type The Content-Type header is used to indicate the media type of the resource. The media type is a string sent along with the file indicating the format of the file. For example, for image file its media type will be like image/png or image/jpg, etc. In response, it tells about the type of returned con 3 min read HTTP headers | Content-Location The HTTP Content-Location header is an entity-header that gives another location for the data that is returned and also tells how to access the resource by indicating the direct URL. Its usage is often confused with another HTTP Header which is Location. The main difference between them is that Loca 1 min read Like