GET /{db}/{doc}/{attachment}

In this document

This request retrieves the file attachment associated with the document. The raw data of the associated attachment is returned (just as if you were accessing a static file). The returned content is the same content type set when the document attachment was added to the database.

Request


Request headers

Query parameters

NameTypeDescriptionDefault
rev stringRevision identifiernone

Message body

Response


Status codes

Response headers

Message body

The message body contains the attachment, in the format specified in the Content-Type header.

Example


Request

The following request retrieves the attachment that was added in the previous example.

GET http://localhost:59840/cookbook/LemonChicken/lcnote.txt?rev=2-6847bbc089e24db84bd0371b9c169566
Host: localhost:59840

Response

HTTP/1.1 200 OK
Accept-Ranges: bytes
Cache-Control: must-revalidate
Content-Length: 112
Content-Type: text/plain; charset=UTF-8
Date: Fri, 13 Dec 2013 22:59:25 GMT
Etag: "2-6847bbc089e24db84bd0371b9c169566"
Server: CouchbaseLite 1.486
Some notes about the Lemon Chicken recipe from testers
* This recipe is fabulous
* I wish it made more servings