o2r-project / o2r-shipper

Export research compendia to repositories and archives
https://o2r.info/results/
Apache License 2.0
0 stars 3 forks source link

Use HTTP 200 instead of 204 for response to DELETE #30

Closed nuest closed 7 years ago

nuest commented 7 years ago

As described in http://o2r.info/o2r-web-api/shipment/#create-a-new-shipment, the response for deleting content in a deposit contains a body, and therefore the response code should be 200, not 204, see https://stackoverflow.com/questions/2342579/http-status-code-for-update-and-delete

ghost commented 7 years ago

Ok, I would not mind even though I think it is a case of

204 (No Content) if the action has been enacted but the response does not include an entity.

since the deletion is done in the remote depot, but I am unsure as of how to interpret "entity" in http 1.1 method definitions

nuest commented 7 years ago

Sure, another solution would be to remove the content in the response and simply return 204.

ghost commented 7 years ago

I noticed just now that the 204 is only a forwarding of the original repo's answer and in constrast to the current web api doc is not given out as API response but only in the shipper's log. I will add a proper response but stick with 204 (without entity). Imagine a scenario where you delete many files from a remote repo then this is a good ways to process it.