User tests: Successful: Unsuccessful:
Pull Request for Issue # .
According to the HTTP/REST specification, a DELETE request for a resource that does not exist should respond with 204 No Content or 404 Not Found.
execute a DELETE api/index.php/v1/content/articles/99
for a non existent item
{ "errors": [ { "code": 500, "title": "Internal server error" } ] }
return 204
Please select:
Documentation link for docs.joomla.org:
No documentation changes for docs.joomla.org needed
Pull Request link for manual.joomla.org:
No documentation changes for manual.joomla.org needed
Status | New | ⇒ | Pending |
Category | ⇒ | Libraries |
no i mean http status code 204 https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/204
no i mean http status code 204 https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/204
I see. Thanks for clarification.
Labels |
Added:
Webservices
PR-5.3-dev
|
Category | Libraries | ⇒ | Libraries JavaScript Unit Tests |
Labels |
Added:
Unit/System Tests
|
@alikon Thank you for adding single System Tests 👍 As this counts for all ressouces, should we add the test everywhere? Or, if this is too expensive, creating one new test like checking-api-status?
And sorry for jumping in at the end — from what I understand, 204 'No Content' is used when a resource is successfully deleted, so there’s nothing to return. If the resource doesn’t exist, then 404 'Not Found' would be the appropriate response — wouldn’t it?
As this counts for all ressouces, should we add the test everywhere? Or, if this is too expensive, creating one new test like checking-api-status?
consider that some api test even don't test the delete endpoint , so don't know what's better
And sorry for jumping in at the end — from what I understand, 204 'No Content' is used when a resource is successfully deleted, so there’s nothing to return. If the resource doesn’t exist, then 404 'Not Found' would be the appropriate response — wouldn’t it?
According to the HTTP/REST specification, a DELETE request for a resource that does not exist should respond with 204
@alikon The title and the expected result say "204". Did you mean "404"?