-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
HTTP REST inconsistency: create should return HTTP 201 #360
Comments
I agree that POST for creation should return HTTP 201. In addition, there should be a 'Location' header with a URL points to the instance being created, for example: Location: http://localhost:3000/api/things/1 Since it will be a breaking change, we'll probably have to fix it in 2.x stream. |
Hey guys, Any news on this issue? I could probably provide a PR for it but I would need some pointers on where the changes should be made. |
up! |
Should be so: |
+1 |
Any update on this issue? Almost a year now for something I would deem critical to REST patterns and service integrators. |
👍 |
Having switched to loopback for my webservice layer I'm having to change all my tests and checks because of this inconsistency. |
@zbitname, PUT also might and should return 201 if the request led to instance creation. 200 for rewriting existing one only. DELETE may return 200 in case you decide to design your API in way DELETE to return deleted item in response. |
LoopBack 3 is in Maintenance LTS mode, only critical bugs and critical security fixes will be provided. We are tracking this request for LoopBack 4 here: loopbackio/loopback-next#788 |
Apparently, POST /api/things returns HTTP 200 - however, 201 is the right code.
The text was updated successfully, but these errors were encountered: