CouchDB supports the following HTTP request methods:
GET
Request the specified item. As with normal HTTP requests, the format of the URL defines what is returned. With CouchDB this can include static items, database documents, and configuration and statistical information. In most cases the information is returned in the form of a JSON document.
HEAD
The HEAD
method is used to get the HTTP
header of a GET
request without the body of
the response.
POST
Upload data. Within CouchDB POST
is used to
set values, including uploading documents, setting document
values, and starting certain administration commands.
PUT
Used to put a specified resource. In CouchDB
PUT
is used to create new objects,
including databases, documents, views and design documents.
DELETE
Deletes the specified resource, including documents, views, and design documents.
COPY
A special method that can be used to copy documents and objects.
If you use the an unsupported HTTP request type with a URL that does not support the specified type, a 405 error will be returned, listing the supported HTTP methods. For example:
{ "error":"method_not_allowed", "reason":"Only GET,HEAD allowed" }
The CouchDB design document API and the functions when returning
HTML (for example as part of a show or list) enables you to
include custom HTTP headers through the headers
block of the return object. For more information, see
???.