Skip to main content

read_body_capped

Function read_body_capped 

Source
pub async fn read_body_capped(
    resp: Response,
    max_bytes: usize,
) -> Result<Bytes, ReadBodyError>
Expand description

Read a response body with a size cap. Returns a typed error on overflow or stream failure — callers produce the appropriate Response variant (Upstream502) so the failure flows through the response chain like any other upstream problem.