The same way it's done on requests.
I saw that response.is_error is available, I was wondering if it was planned or not (as I was considering httpx some kind of drop-in replacement for requests)?
Thanks again
Nope, I doubt we’d do that.
I'm inclined towards a "no" too, basically for the same reason we don't have response.ok: ambiguous — and in this case, possibly error-prone.
(Eg. if you use if not response: ... would that be to check whether response is set, or whether the response is "falsy"? What would "falsy" mean? response.is_error? Then we should access this attribute explicitly.)
Most helpful comment
I'm inclined towards a "no" too, basically for the same reason we don't have
response.ok: ambiguous — and in this case, possibly error-prone.(Eg. if you use
if not response: ...would that be to check whetherresponseis set, or whether the response is "falsy"? What would "falsy" mean?response.is_error? Then we should access this attribute explicitly.)