reqwest-debug-json

Provides inspect_json method for reqwest's response object. Can be usefull for response json-tracing purposes.

Example:

```rust use reqwestinspectjson::InspectJson;

[derive(Serialize, Deserialize, Debug, PartialEq, Clone)]

struct TestDataClass { key1: String, key2: String, }

[derive(Serialize, Deserialize, Debug)]

struct Response { json: TestDataClass, }

let testdata = TestDataClass { key1: "asdada".toowned(), key2: "asdagfdgdf".toowned(), }; let testdatacopy = testdata.clone();

let client = reqwest::Client::new(); let response = client .post("http://httpbin.org/post") .json(&testdata) .send() .await .expect("Request failed") .inspectjson::(move |text| { println!("Json content: {}", text); let textdata = serdejson::fromstr::(text).expect("Parsing failed"); asserteq!(textdata.json, testdata_copy); }) .await .expect("Response parse failed");

asserteq!(response.json, testdata); ```