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

Only error responses have a status property #143

Open
bertday opened this issue Dec 1, 2017 · 0 comments
Open

Only error responses have a status property #143

bertday opened this issue Dec 1, 2017 · 0 comments

Comments

@bertday
Copy link
Contributor

bertday commented Dec 1, 2017

Error responses from the API have a status property, e.g. 404:

{
  "status": 404,
  "error": "Not Found",
  "message": "Could not find any addresses matching query.",
  "details": {
    "normalized": "12345 MARKET ST",
    "query": "12345 market st",
  "search_type": "street"
  }
}

However, good responses don't have a status. This means that client apps can't write logic such as:

if aisResponse.status == 404:
   // do something

since status doesn't always exist.

This should probably be consistent across all cases -- either by including a status on good responses, or by always sending back HTTP status codes in the headers. The former sounds more convenient.

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

No branches or pull requests

1 participant