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

Rest API: DELETE method always returns 204 #1322

Closed
Kampfgnom opened this issue Apr 21, 2015 · 5 comments
Closed

Rest API: DELETE method always returns 204 #1322

Kampfgnom opened this issue Apr 21, 2015 · 5 comments
Assignees

Comments

@Kampfgnom
Copy link

When calling DELETE on a resource, the response code is always 204 with an empty body, independently from whether the resource exists or not, or if it has been deleted or not (headers omitted for brevity):

$ curl -i http://localhost:3000/api/TodoLists
HTTP/1.1 200 OK
[]

$ curl -i -X PUT http://localhost:3000/api/TodoLists
HTTP/1.1 200 OK
{"id":"27e2ea50-e814-11e4-8782-29c27147e8f9"}

$ curl -i http://localhost:3000/api/TodoLists
HTTP/1.1 200 OK
[{"title":null,"id":"27e2ea50-e814-11e4-8782-29c27147e8f9","systemUserId":null}]

$ curl -i -X DELETE http://localhost:3000/api/TodoLists/asd
HTTP/1.1 204 No Content

$ curl -i http://localhost:3000/api/TodoLists
HTTP/1.1 200 OK
[{"title":null,"id":"27e2ea50-e814-11e4-8782-29c27147e8f9","systemUserId":null}]

$ curl -i -X DELETE http://localhost:3000/api/TodoLists/27e2ea50-e814-11e4-8782-29c27147e8f9
HTTP/1.1 204 No Content

$ curl -i http://localhost:3000/api/TodoLists
HTTP/1.1 200 OK
[]

$ curl -i -X DELETE http://localhost:3000/api/TodoLists/27e2ea50-e814-11e4-8782-29c27147e8f9
HTTP/1.1 204 No Content

I see the same behaviour in the API-explorer and my (currently in development) Qt-Client.

Thanks for any help.

@superkhau superkhau self-assigned this Apr 21, 2015
@superkhau superkhau added #wip and removed #wip labels Apr 21, 2015
@superkhau
Copy link
Contributor

@Kampfgnom I've verified your observations and 204 is always returned as you described. Escalating to bug status.

@fabien
Copy link
Contributor

fabien commented Jul 24, 2015

@raymondfeng we should really get this fixed, see also: #1543 (comment)

I would suggest a config option: deleteInfo as well as Model.settings.deleteInfo or something like that to enable it. Ideally I would like such option to work like this: loopbackio/loopback-connector-mongodb#164 (comment) - but with the global setting to be in your app config.

@raymondfeng
Copy link
Member

Sure. @superkhau Can you take this one? It's very similar as the work you did for update.

@superkhau superkhau self-assigned this Jul 29, 2015
@superkhau
Copy link
Contributor

Assigned to myself so we can prioritize during sprint planning.

/cc @chandadharap

@superkhau superkhau added the #tob label Aug 6, 2015
@chandadharap chandadharap added #plan and removed #tob labels Aug 11, 2015
@chandadharap chandadharap added #plan and removed #tob labels Aug 20, 2015
@superkhau superkhau added triaging and removed bug labels Aug 25, 2015
@superkhau
Copy link
Contributor

  • Functional test the above endpoints
  • Escalate to bug status depending on the results of the functional tests
  • Make functional tests pass
    • Isolate where the error is coming from
    • Add the fix

@chandadharap chandadharap added #tob and removed #plan labels Aug 25, 2015
@chandadharap chandadharap added #plan and removed #tob labels Sep 3, 2015
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

5 participants