Which HTTP headers can indicate the size of the response payload?

Study for the Wireshark Block 5 Exam. Prepare with flashcards and multiple choice questions, each offering hints and explanations. Ace your exam with the best resources!

Multiple Choice

Which HTTP headers can indicate the size of the response payload?

Explanation:
The size of the response payload is indicated by specific HTTP headers, most directly by Content-Length. This header provides the exact number of bytes in the response body, so the recipient knows exactly how much data to read. When the server uses chunked transfer encoding, it sets Transfer-Encoding: chunked. In this mode, the body is sent in chunks, each preceded by its size, and there is no single total length announced at the start; the sequence ends with a zero-length chunk. Together, these headers tell you either the total payload size or how to parse a streaming body when the total size isn’t known upfront. The other header pairs don’t convey payload size: host and user-agent identify the client and server; accept and content-type describe data formats; and connection and cache-control relate to persistence and caching rather than the payload length.

The size of the response payload is indicated by specific HTTP headers, most directly by Content-Length. This header provides the exact number of bytes in the response body, so the recipient knows exactly how much data to read. When the server uses chunked transfer encoding, it sets Transfer-Encoding: chunked. In this mode, the body is sent in chunks, each preceded by its size, and there is no single total length announced at the start; the sequence ends with a zero-length chunk. Together, these headers tell you either the total payload size or how to parse a streaming body when the total size isn’t known upfront. The other header pairs don’t convey payload size: host and user-agent identify the client and server; accept and content-type describe data formats; and connection and cache-control relate to persistence and caching rather than the payload length.

Subscribe

Get the latest from Passetra

You can unsubscribe at any time. Read our privacy policy