Skip to main content

read_json_limited

Function read_json_limited 

Source
pub async fn read_json_limited<T: DeserializeOwned>(
    response: Response,
    limit: usize,
) -> Result<T, BodyReadError>
Expand description

Read the whole body and parse it as JSON, failing when it is larger than limit bytes.

ยงErrors

Same as read_body_limited, plus BodyReadError::Json when the body does not parse as T.