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

Always return the requested format #41

Closed
cimm opened this issue Mar 14, 2015 · 2 comments
Closed

Always return the requested format #41

cimm opened this issue Mar 14, 2015 · 2 comments

Comments

@cimm
Copy link
Contributor

cimm commented Mar 14, 2015

It would be nice if the API would always returns XML or JSON (depending on the format in the query). Right now it might return XML or JSON when the query is successful but might return plain text when the station isn't found. Other errors might return the correct format.

Take http://api.irail.be/connections/?to=heaven&from=hell&format=xml for example, which returns plain text. This means the client implementation needs to call a different parser if the XML or JSON parser can't parse the result.

It does do the right thing when you send a broken query like http://api.irail.be/connections/?format=xml though.

@pietercolpaert
Copy link
Member

Good point! Thanks for the issue!

@pietercolpaert
Copy link
Member

Fixed

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

No branches or pull requests

2 participants