HTTP HTTP for APIs Delete a resource


Example

Another common use of HTTP APIs is to delete an existing resource. This should usually be done using DELETE requests.

If the deletion was successful, the server should return 200 OK; an appropriate error code if it was not.

If our employee Charlie Smith has left the company and we now want to delete his records, that might look like this:

DELETE /employees/1/charlie-smith HTTP/1.1
Host: example.com
HTTP/1.1 200 OK
Content-Type: application/json

{
    'links': [
        {
            'uri': '/employees',
            'rel': 'create',
            'method': 'POST'
        }
    ]
}