Skip to content
This repository was archived by the owner on Oct 17, 2022. It is now read-only.

Update the PUT {attachment} docs to reflect observed behavior.#189

Merged
janl merged 2 commits into
masterfrom
putAttWithoutRev
Oct 28, 2017
Merged

Update the PUT {attachment} docs to reflect observed behavior.#189
janl merged 2 commits into
masterfrom
putAttWithoutRev

Conversation

@flimzy
Copy link
Copy Markdown
Member

@flimzy flimzy commented Oct 26, 2017

This updates the docs to reflect that it is possible to create an empty document with PUT /{db}/{docid}/{attname}. Example with 2.1.0:

$ curl -v -X PUT http://admin:abc123@localhost:6002/foo/asdf/asdf.txt -H 'Content-Type: text/plain' -d 'Foo'
*   Trying ::1...                                                                                                                                                                                                                
* TCP_NODELAY set                                                                                                                                                                                                                
* Connected to localhost (::1) port 6002 (#0)                                                                                                                                                                                    
* Server auth using Basic with user 'admin'                                                                                                                                                                                      
> PUT /foo/asdf/asdf.txt HTTP/1.1                                                                                                                                                                                                
> Host: localhost:6002                                                                                                                                                                                                           
> Authorization: Basic YWRtaW46YWJjMTIz                                                                                                                                                                                          
> User-Agent: curl/7.52.1                                                                                                                                                                                                        
> Accept: */*                                                                                                                                                                                                                    
> Content-Type: text/plain                                                                                                                                                                                                       
> Content-Length: 3                                                                                                                                                                                                              
>                                                                                                                                                                                                                                
* upload completely sent off: 3 out of 3 bytes                                                                                                                                                                                   
< HTTP/1.1 201 Created                                                                                                                                                                                                           
< X-CouchDB-Body-Time: 0                                                                                                                                                                                                         
< X-Couch-Request-ID: 10e7ef8da3                                                                                                                                                                                                 
< Server: CouchDB/2.1.0 (Erlang OTP/17)
< Location: http://localhost:6002/foo/asdf/asdf.txt
< Date: Thu, 26 Oct 2017 21:59:14 GMT
< Content-Type: application/json
< Content-Length: 67
< Cache-Control: must-revalidate
< 
{"ok":true,"id":"asdf","rev":"1-50e6c151017d2056dde49c7a02388b29"}
* Curl_http_done: called premature == 0
* Connection #0 to host localhost left intact

@janl janl merged commit c9f0ac4 into master Oct 28, 2017
@janl janl deleted the putAttWithoutRev branch October 28, 2017 11:47
@janl
Copy link
Copy Markdown
Member

janl commented Oct 28, 2017

thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants