Delete a Content Item
To delete a content item, your client application must send an HTTP
DELETE
request to the same URI that would be used to
retrieve it (see
Retrieve a Content Item). For example:
curl --include -u user:password -X DELETE \>
http://host-ip-address/webservice/escenic/content/43HTTP/1.1 204 No Content Server: Apache-Coyote/1.1 Date: Tue, 19 Feb 2013 09:12:00 GMT
If you're using curl
, it's a good idea to specify
--include
with DELETE
operations:
curl
will then output the response header returned
from the web service as shown above, and you can verify whether or not
the operation was successful:
-
A response code in the 2xx range indicates success.
-
A response code in the 4xx range means that you made an invalid edit and the server won’t accept your modification.
-
A response code in the 5xx range means there is a server error.
When you delete a content item, the object is not actually deleted
from the database: its state is set to deleted
,
which means that it can be undeleted in the future if necessary.