#response #reqwest #response-body #blocking #traits #extension #shape

reqwest-response-ext

Extension trait for reqwest::{blocking}::Response

1 unstable release

0.1.0 Jun 12, 2023

#23 in #response-body

Apache-2.0 OR MIT

9KB
136 lines

When using reqwest sometimes you need to decide how to consume the response body based on the response status or even based on some external input. reqwest::Response, however, doesn't allow you to do it easily. TypedResponse in this crate allows you to do exactly that.


lib.rs:

TypedResponse allows you to keep response body data, while remembering the desired shape of both success and failure variant. TypedResponse lets you extract raw body, or deserialize it into either serde_json::Value or required success/failure shape based on the original response HTTP status.

Dependencies

~4–15MB
~221K SLoC