Why is a 204 is returned when deleting a non-existant object?
Wouldn’t a 404 be more approprate; to indicate the object does not exist, and it is not possible to delete?
$ http :8001/services
HTTP/1.1 200 OK
Access-Control-Allow-Origin: *
Connection: keep-alive
Content-Type: application/json; charset=utf-8
Date: Thu, 09 Aug 2018 15:16:58 GMT
Server: kong/0.33-enterprise-edition
Transfer-Encoding: chunked
{
"data": [],
"next": null
}
$ http delete :8001/services/123-123
HTTP/1.1 204 No Content
Access-Control-Allow-Origin: *
Connection: keep-alive
Date: Thu, 09 Aug 2018 15:17:14 GMT
Server: kong/0.33-enterprise-edition
Is the same as deleting an existing service.
$ http post :8001/services name=test url=https://httpbin.org
HTTP/1.1 201 Created
Access-Control-Allow-Origin: *
Connection: keep-alive
Content-Type: application/json; charset=utf-8
Date: Thu, 09 Aug 2018 15:17:56 GMT
Server: kong/0.33-enterprise-edition
Transfer-Encoding: chunked
{
"connect_timeout": 60000,
"created_at": 1533827876,
"host": "httpbin.org",
"id": "06d30d75-8eaa-4978-95f3-a9d7453fdb8d",
"name": "test",
"path": null,
"port": 443,
"protocol": "https",
"read_timeout": 60000,
"retries": 5,
"updated_at": 1533827876,
"write_timeout": 60000
}
$ http delete :8001/services/06d30d75-8eaa-4978-95f3-a9d7453fdb8d
HTTP/1.1 204 No Content
Access-Control-Allow-Origin: *
Connection: keep-alive
Date: Thu, 09 Aug 2018 15:18:07 GMT
Server: kong/0.33-enterprise-edition