DevToolsmith

Transfer-Encoding Header

The Transfer-Encoding response header says how the body is framed on an HTTP/1.1 connection; in practice, always chunked.

Type
Response header
Category
Content and negotiation
Defined in
RFC 9112

Syntax

Transfer-Encoding: chunked

How Transfer-Encoding works

chunked lets a server stream a body whose length it doesn’t know yet, in pieces each preceded by its size. HTTP/2 and HTTP/3 frame data themselves and forbid this header. Unlike Content-Encoding, it applies to one hop only, and proxies may change it.

Examples

A streamed response
Transfer-Encoding: chunked

Common mistakes

  • A message must not have both Transfer-Encoding and Content-Length. Servers and proxies that disagree about which wins are the root of request smuggling attacks.

Check it

curl -sI https://example.com | grep -i '^transfer-encoding:'

Paste a full set of response headers into the HTTP header checker to get every header explained and common mistakes flagged.

Related headers

  • Content-Length: gives the size of the body in bytes.
  • Content-Encoding: names the compression applied to the body, such as gzip, br (Brotli) or zstd.
  • Server-Timing: reports how long the server spent on each step, shown in the browser’s network panel.

More content and negotiation headers

Content-Type , Content-Disposition , Accept , Accept-Encoding , Accept-Language , Range .

Sources

Spotted a mistake? Email hello@devtoolsmith.com and we’ll fix it.

Frequently asked questions

What does the Transfer-Encoding header do?

The Transfer-Encoding response header says how the body is framed on an HTTP/1.1 connection; in practice, always chunked. chunked lets a server stream a body whose length it doesn’t know yet, in pieces each preceded by its size. HTTP/2 and HTTP/3 frame data themselves and forbid this header. Unlike Content-Encoding, it applies to one hop only, and proxies may change it.

How do I see the Transfer-Encoding header?

Run "curl -sI https://example.com" to print a response’s headers, or open the Network tab in your browser’s dev tools and select the request. Paste the headers into the HTTP header checker on this site to get each one explained.