Both requests and responses might have an associated data blob, also called an entity in HTTP terminology. The size of the entity is determined using one of three different methods:
The complete size of the entity is sent as a header (the Content-Length header).
The transport layer connection is terminated when transfer of the blob is completed (used by HTTP/0.9 and might be used in HTTP/1.1 in non-persistent mode).
Instead of specifying the complete length, smaller chunks of the complete blob are transferred, and each chunk is prefixed with the size of that specific chunk. The end of the stream is denoted by a zero-length chunk. This mode is also called chunked encoding and is specified by the Transfer-Encoding header.
Example 4.4. Example HTTP transaction |
---|
GET /index.html HTTP/1.1 Host: www.example.com Connection: keep-alive User-Agent: My-Browser-Type 6.0 HTTP/1.1 200 OK Connection: close Content-Length: 14 <html> </html> |
© 2021 BalaSys IT Security.
Send your comments to support@balasys.hu