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

Refactor all HTTP requests into client classes #37

Merged
merged 9 commits into from
Oct 19, 2015

Conversation

JayH5
Copy link
Contributor

@JayH5 JayH5 commented Oct 5, 2015

Supersedes #35, comparing against develop this time.

* Let JsonClient._log_http_error handle everything
* Keep a default endpoint in the base class, add a kwarg for
  specifying a different endpoint.
* Add get_json() method to perform a GET request expecting a JSON
  response.
* Only try get JSON content if OK response code
* Add new UnexpectedResponseError type
* Handle 404's that should be ignored in main Consular class
* Add tests
@JayH5
Copy link
Contributor Author

JayH5 commented Oct 19, 2015

ping 🔔

Get the response JSON content if the respones code is OK (200), else
raise an `UnexpectedResponseError`.
"""
if response.code == OK:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The full range of 2xx is essentially OK, does OK cover these?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@smn
Copy link
Contributor

smn commented Oct 19, 2015

👍

JayH5 added a commit that referenced this pull request Oct 19, 2015
Refactor all HTTP requests into client classes
@JayH5 JayH5 merged commit 67d1679 into develop Oct 19, 2015
@JayH5 JayH5 deleted the feature/adhoc-refactor branch October 19, 2015 13:35
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