rvcr
Record-and-replay testing middleware for reqwest http client.
Inspired by:
Builds on top of:
Examples
To record HTTP requests, initialize client like following
use PathBuf;
use Client;
use ;
use ;
let mut bundle = from;
bundle.push;
let middleware: VCRMiddleware = try_from
.unwrap
.with_mode;
let vcr_client: ClientWithMiddleware = new
.with
.build;
Now ClientWithMiddleware instance will be recording requests to a file
located in tests/resources/replay.vcr.json inside the project.
To use recorded VCR cassette files, replace .with_mode(VCRMode::Record)
with .with_mode(VCRMode::Replay), or omit it, since replay is used by default.
Search mode
When replaying, rVCR can skip requests already found when searching for
subsequent requests (the default). To disable skipping requests,
which is useful, for example, if requests are done in parallel and responses
may come in random order, use .with_search(VCRReplaySearch::SearchAll).