Skip to main content

Module request

Module request 

Source
Expand description

Applying a content coding to a request body.

There is no standard signal that indicates a server accepts request body encoding ahead of sending. Therefore, doing so always requires out-of-band knowledge in some way or shape. (RFC 9110 §15.5.16 does specify that servers should answer encodings they can’t decode with an Accept-Encoding header; that would require buffering and re-sending the request, so we don’t implement it automatically.)

Functions§

compress_buffer
Compress a buffered request body, yielding the bytes that go on the wire.
compress_stream
Compress a streaming request body as its chunks arrive.
encode
Compress a request body in coding, and declare it in the headers.
encode_stream
Compress a streaming request body in coding, and declare it in the headers.

Type Aliases§

RequestStream
A request body stream, as reqwest takes one.