Delete a Document
This is a cURL request to delete the document "employees/1-A" from a database named "Example" on our playground server:
curl -X DELETE "http://live-test.ravendb.net/databases/Example/docs?id=employees/1-A"
HTTP/1.1 204 status: 204 Server: nginx Date: Tue, 27 Aug 2019 11:40:12 GMT Connection: keep-alive Raven-Server-Version: 220.127.116.11
This is the general format of the cURL request:
curl -X DELETE "<server URL>/databases/<database name>/docs?id=<document ID>" --header "If-Match: <expected change vector>"
|id||ID of a document to be deleted.||Yes|
|If-Match||Expected change vector. If it matches the server-side change vector the document is deleted, if they don't match a concurrency exception is thrown.||No|
|Content-Type||MIME media type and character encoding. This should always be:
|Raven-Server-Version||Version or RavenDB the responding server is running|
|HTTP Status Code||Description|
||The document was successfully deleted, or no document with the specified ID exists.|
||The change vector submitted did not match the server-side change vector. A concurrency exception is thrown.|