Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Raise for status when fetching w/ requests #1050

Closed

Conversation

gadomski
Copy link

@gadomski gadomski commented Feb 22, 2023

In the case of (e.g.) 404 errors that still return a response, this will let the 404 error propagate instead of a JSON decode error (if the response isn't JSON). See the last paragraph of https://requests.readthedocs.io/en/latest/user/quickstart/#json-response-content for some text about this.


📚 Documentation preview 📚: https://python-jsonschema--1050.org.readthedocs.build/en/1050/

In the case of (e.g.) 404 errors that still return a response, this will let the
404 error propagate instead of a JSON decode error (if the response isn't JSON).
See the last paragraph of
https://requests.readthedocs.io/en/latest/user/quickstart/#json-response-content
for some text about this.
@Julian
Copy link
Member

Julian commented Feb 22, 2023

Thanks for the PR, it's appreciated. This entire interface is changing however in #1049, where you're going to be entirely in control of how you make HTTP requests (this in particular is a preview of what sounds like the equivalent of what you have now, and you can certainly raise for status there).

Going to close this given it'd not see the light of day given the changeover, but feedback is definitely welcome on the new APIs if they do or don't suit you, and again, thanks for the PR regardless.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants