Feature Request: Support Http trailers in chunked transfer
Trailers in chunked transfer are described by rfc3230-section 4.1. Net/http does not support setting trailers nor is there a way for users to implement chunked trailers on top of net/http. The grammar is (combining section 4.1 and 4.1.2):
chunked-body = *chunk
last-chunk
trailer-part
CRLF
chunk = chunk-size [ chunk-ext ] CRLF
chunk-data CRLF
chunk-size = 1*HEXDIG
last-chunk = 1*("0") [ chunk-ext ] CRLF
chunk-data = 1*OCTET ; a sequence of chunk-size octets
trailer-part = *( header-field CRLF )
When a body_stream is set and the transfer-encoding is chunked, GenericRequest#send_request_with_body_stream creates a Chunker . The Chunker correctly follows the rfc in writing out the chunks and writing the last-chunk as "0\r\n\r\n". However, there are no hooks or support for writing the trailer-part.
@hsbt Any input on this? Would a pull request be welcomed?
Would the maintainers accept an implementation PR?