Forked from max-mapper/couchdb-custom-header-attachments.txt
Created
May 7, 2011 00:57
-
-
Save tilgovi/960094 to your computer and use it in GitHub Desktop.
Revisions
-
tilgovi revised this gist
May 7, 2011 . 1 changed file with 4 additions and 5 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -23,8 +23,7 @@ Host: localhost Accept: */* Content-Type: image/jpeg Content-Length: 424129 X-Couch-Attachment-Header: Access-Control-Allow-Origin: * X-Couch-Attachment-Header: Access-Control-Allow-Methods: GET, POST, OPTIONS X-Couch-Attachment-Header: Access-Control-Allow-Headers: Content-Type X-Couch-Attachment-Header: Access-Control-Max-Age: 86400 -
max-mapper created this gist
May 7, 2011 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,30 @@ INLINE ATTACHMENT { _attachments: { "awesome.jpeg": { content_type: "image/jpeg", data: "base64 data goes here", headers: { "Access-Control-Allow-Origin": "*", "Access-Control-Allow-Methods": "GET, POST, OPTIONS", "Access-Control-Allow-Headers": "Content-Type", "Access-Control-Max-Age": "86400", "Whatever-You-Want": "Gets stored" } } } } STANDALONE ATTACHMENT PUT /db/id/awesome.jpeg?rev=2-c9b53a4004d3ef5dc290bbb06c672e61 HTTP/1.1 Host: localhost Accept: */* Content-Type: image/jpeg Content-Length: 424129 Access-Control-Allow-Origin: * Access-Control-Allow-Methods: GET, POST, OPTIONS Access-Control-Allow-Headers: Content-Type Access-Control-Max-Age: 86400 Whatever-You-Want: Gets stored