Skip to main content

read_body_capped

Function read_body_capped 

Source
pub async fn read_body_capped(resp: Response) -> Result<String, (Error, bool)>
Expand description

Read a response body, streaming chunks with a running byte cap so an oversized body is bounded before it is ever parsed. The bool in the error reports whether the read failure is transient (worth retrying).

Decodes as UTF-8. Use read_body_capped_bytes when the response’s declared charset matters.