Skip to main content

read_response_text

Function read_response_text 

pub async fn read_response_text(
    response: Response,
    limit: Option<usize>,
) -> Result<(String, bool)>
Expand description

Read bounded HTTP response text with UTF-8-safe truncation. Read a response body up to limit bytes and return UTF-8-safe text.

The boolean is true when the response exceeded the limit. The reader retains at most one byte beyond the limit to detect overflow.