HTTPX · Method
response.raise_for_status
Response.raise_for_status() checks an HTTP response status. It returns the response for 2xx results and raises httpx.HTTPStatusError for 4xx or 5xx results.
Last updated
Syntax
response.raise_for_status()In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.
SubscribeRelated
httpx.HTTPStatusErrorhttpx.HTTPErrorhttpx.RequestErrorResponse.status_codeResponse.json