reqwest icon indicating copy to clipboard operation
reqwest copied to clipboard

provide client wide config for `error_for_status`

Open Luro02 opened this issue 6 years ago • 1 comments

It'd be awesome, to have a configuration in the ClientBuilder, to error by default for all responses with an invalid status code.

let client = Client::builder()
    .error_for_status(true)
    .build()?;

client.get("https://www.google.com/idontexist").send().await?; // this should error

Luro02 avatar Oct 20 '19 05:10 Luro02

Some discussion about implementing this is happening on PR #875

joshka avatar Sep 27 '24 20:09 joshka