Chunked transfer encoding

Chunked transfer encoding is a streaming data transfer mechanism available in Hypertext Transfer Protocol (HTTP) version 1.1, defined in RFC 9112 §7.1. In chunked transfer encoding, the data stream is divided into a series of non-overlapping "chunks". The chunks are sent out and received independently of one another. No knowledge of the data stream outside the currently-being-processed chunk is necessary for both the sender and the receiver at any given time.

Each chunk is preceded by its size in bytes. The transmission ends when a zero-length chunk is received. The chunked keyword in the Transfer-Encoding header is used to indicate chunked transfer.

Chunked transfer encoding is not supported in HTTP/2, which provides its own mechanisms for data streaming.[1]

  1. ^ HTTP/2. June 2022. sec. 8.1. doi:10.17487/RFC9113. RFC 9113. HTTP/2 uses DATA frames to carry message payloads. The chunked transfer encoding defined in Section 7.1 of [HTTP/1.1] MUST NOT be used in HTTP/2