This crate provides a few separately usable but closely related HTTP ecosystem components.
In the root module,
BodySink and supporting types provide a
strategy for safely handling potentially large HTTP request or response
bodies without risk of allocation failure, or the need to impose awkwardly
low size limits in the face of high concurrency.
thresholds can be used to decide when to accumulate the body in RAM vs the
filesystem, including when the length is unknown in advance.
See the top level README for additional rationale.
Dialog defines a complete HTTP request and
response recording, using
BodyImage for the request and response bodies
and http crate types for the headers and other components.
The barc module defines a container file format, reader and writer for dialog records. This has broad use cases, from convenient test fixtures for web applications, to caching and web crawling.
The following features may be enabled or disabled at build time. All are enabled by default.
async: The async module for input to
BodySink, output of
BodyImage, and recording of HTTP
hyper 0.12+ and tokio. Originally the async module was named
client , but this would be misleading as async is also usable in a
server (request or response contexts as well). The client path name,
now a re-export, is deprecated as of 0.4.0 in preference to the async
barc command line tool for viewing
(e.g. compressed) records and copying records across BARC files. If the
async feature is enabled, then a
record command is also provided for
live BARC recording from the network.
brotli: Brotli transfer/content decoding in async module, and Brotli BARC record compression (in barc), via the native-rust brotli crate. (Gzip, via the flate2 crate, is standard.)
BodyImage::mem_map support for memory mapping
Asynchronous HTTP integration and utilities.
Body Archive container file format, reader and writer.
A logical buffer of bytes, which may or may not be RAM resident.
A logical buffer of bytes, which may or may not be RAM resident, in the
process of being written. This is the write-side corollary to
An HTTP request and response recording.
A collection of size limits and performance tuning constants. Setters are
A builder for
Error enumeration for
A subset of supported HTTP Transfer or Content-Encoding values. The
Exploded representation of the possible
The crate version string.
Access by reference for HTTP request (via
Access by reference for HTTP request recording types.
Similar to the
Similar to the