HTTP Chunked Encoding. Need an example of ‘Trailer’ mentioned in SPEC

Below is a copy of an example trailer I copied from The TCP/IP Guide site.
trailer sample

As we can see, if we want to use trailer header, we need add a “Trailer:header_name” header field with a header name and then add the trailer header entity after chunked body area.

We can add 0 or more trailer headers in a HTTP body per the RFC.
Section 4.1.2 of RFC7230 bans the use of following headers in trailer header area:

A sender MUST NOT generate a trailer that contains a field necessary
for message framing (e.g., Transfer-Encoding and Content-Length),
routing (e.g., Host), request modifiers (e.g., controls and
conditionals in Section 5 of RFC7231), authentication (e.g., see
RFC7235 and RFC6265), response control data (e.g., see Section 7.1
of RFC7231), or determining how to process the payload (e.g.,
Content-Encoding, Content-Type, Content-Range, and Trailer).

This means we can use other standard headers and custom headers in trailer header area.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)