Skip to main content

Trailer

BothActive

The Trailer header lists which fields will appear in the trailer section of a chunked transfer-encoded message – headers sent after the body. Common uses: checksum fields (Digest) sent after streaming, MD5 validation, and gRPC status codes. The client signals it can receive trailers via TE: trailers.

Trailer: <header-name>[, <header-name>]*

Description

Trailer announces which header fields will appear at the end of a chunked response body. The trailer fields are sent after the final 0-length chunk. This allows the server to stream the body while computing values like a checksum that require the full body. Certain headers cannot be sent as trailers: Transfer-Encoding, Content-Length, Host, Trailer itself, and authentication headers. gRPC uses HTTP/2 trailers for grpc-status and grpc-message.

Examples

Announce checksum trailer
http
HTTP/1.1 200 OK
Transfer-Encoding: chunked
Trailer: Digest

[chunked body]
0
Digest: sha-256=:abc123...:

Related

Specification

RFC 9110Trailer specification →