Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace
response.ok
with response.status_code < 400
The .ok is part of the requests API [1], but not part of the httpx API. An equivalent check, according to the requests docs, is to use response.status_code < 400 (In fact, requests' implementation is a try/except around raise_for_status, but this should be the same, although we could use the same pattern instead.) Note that response.status_code < 400 should work with both, requests and httpx, and thus remain backwards compatible. [1]: https://requests.readthedocs.io/en/latest/api/#requests.Response.ok Closes #308.
- Loading branch information