Skip to main content

json_capped

Function json_capped 

Source
pub async fn json_capped<T: DeserializeOwned>(
    resp: Response,
    max_bytes: usize,
) -> Result<T>
Expand description

Convenience: fetch JSON with a hard body cap. Returns T on success, or an error if the cap is exceeded / parsing fails.