Skip to main content

json

Function json 

Source
pub fn json(response: &WireResponse) -> Result<Value>
Expand description

Turn one response’s bytes into a JSON document.

A non-success status becomes Error::ApiStatus carrying the body, because every tapes error body is {"error": "..."} and the bare status never names the offending parameter.

A successful response with no body decodes to Value::Null rather than failing: cassette routes are free to answer 204, and a client that treated that as malformed would refuse a perfectly good answer.