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

Correctly handle success-but-no-content responses #13

Merged
merged 3 commits into from Dec 19, 2011

Conversation

carljm
Copy link
Contributor

@carljm carljm commented Dec 3, 2011

There are several success response codes that are listed as False in HttpObject.response_has_content: 202 Accepted and 204 No Content. Currently HttpObject.update_from_response does not respect response_has_content, and so if it actually receives a non-error response without body content, it results in a ValueError "No JSON object could be decoded."

These changes add a test for that case, and fix it, by simply not trying to update data from a response that is not expected to contain content.

apparentlymart added a commit that referenced this pull request Dec 19, 2011
Correctly handle success-but-no-content responses
@apparentlymart apparentlymart merged commit ff4aea3 into saymedia:master Dec 19, 2011
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.

None yet

2 participants