HTTP content
In HTTP messages, thecontent describes the 'information' conveyed in the message body (which follows the header section), after any message framing from HTTP/1.1 chunked transfer encoding has been removed.This was referred to as a "payload" in HTTP/1.1, but message "content" distinguishes from frame payloads in HTTP/2 and HTTP/3 where the data in a single frame could be header data, body data, or other control information.
The purpose of message content in HTTP requests and responses depends on the request method and response status code.For example, in aPUT request, the content represents the desired state of the resource, but in aPOST request, it is information to be processed.A200 OK response to aGET request shows the current state of the resource, while an error response describes the error.
Some responses, like those toHEAD requests or204 No Content and304 Not Modified status codes, do not include content at all.
In the following HTTP/1.1 response, the message body contains the contentMozilla Developer Network:
HTTP/1.1 200 OKContent-Type: text/plainMozilla Developer NetworkIn the next HTTP/1.1 response, transfer encoding encodes the data into chunks.The content is stillMozilla Developer Network in the end, but the message body includes different message data to separate the chunks:
HTTP/1.1 200 OKContent-Type: text/plainTransfer-Encoding: chunked7\r\nMozilla\r\n9\r\nDeveloper\r\n7\r\nNetwork\r\n0\r\n\r\nIn this article
See also
Content-Location413 Content Too Large- Content header
- RFC 9110, section 6.4: Content (obsoletesRFC 7231 Payload Semantics)