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

Proper HTTP codes for some responses #7

Open
igorsantos07 opened this issue Apr 24, 2014 · 2 comments
Open

Proper HTTP codes for some responses #7

igorsantos07 opened this issue Apr 24, 2014 · 2 comments

Comments

@igorsantos07
Copy link

I think some error requests are returning wrong HTTP codes... Not sure though, but according to the HTTP RFC:

  • When a resource is non-existent it should return a 404 Not Found response. Trying to GET /santa-claus I receive a 500 instead.
  • When a method is not accepted for a given resource the server should return a 405 Method Not Allowed instead of the 404 I'm currently getting. Example: PATCH /posts
@typicode
Copy link
Owner

typicode commented May 6, 2014

I agree there's room for improvements here. JSONPlaceholder depends on an old version of JSON-Server.

Especially the PATCH method should work.

@igorsantos07
Copy link
Author

Actually, PATCH does work (except for #9). I said that based on conflicting doc (#5). I'm not really sure if there's any verb that's not supported by the service... Maybe it could reply 405 for, say, OPTIONS? This way we can write tests that handle correctly unsupported verbs.

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