← All headersGeneral header

What is a Transfer-Encoding header?

Specifies the form of encoding used to safely transfer the body, most commonly chunked.

Chunked Transfer-Encoding lets a website start sending a response before it knows the total size - handy for streaming or dynamically generated pages where buffering the whole body first would add latency. It interacts awkwardly with some proxies and load balancers if misconfigured, occasionally producing responses that hang or cut off early, which is another reason an uptime monitor that measures full response completion (not just a successful connection) earns its keep on anything using it.

Common use case

A server-sent events endpoint or a dynamically generated report streams its response in chunks as data becomes available, rather than buffering the entire body first to compute a Content-Length.

Example

Transfer-Encoding: chunked

History

Part of the original HTTP/1.1 specification, RFC 2068 (1997).

Did you know?

A mismatched or maliciously smuggled Transfer-Encoding and Content-Length pair is the classic root cause of HTTP request smuggling attacks, which is why modern proxies reject requests that specify both.