Skip to content

Instantly share code, notes, and snippets.

@rnewson
Created January 30, 2014 14:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rnewson/8709497 to your computer and use it in GitHub Desktop.
Save rnewson/8709497 to your computer and use it in GitHub Desktop.
Last login: Thu Jan 30 13:49:07 on ttys006
curl l% ➜ ~ curl localhost:5984/db1 -XPUT
{"ok":true}
➜ ~ curl localhost:5984/db1/doc1 -XPUT -d {}
{"ok":true,"id":"doc1","rev":"1-967a00dff5e02add41819138abb3284d"}
➜ ~ curl 'localhost:5984/db1/doc1?rev=1-967a00dff5e02add41819138abb3284d' -X DELETE
{"ok":true,"id":"doc1","rev":"2-eec205a9d413992850a6e32678485900"}
➜ ~ curl 'localhost:5984/db1/doc1?latest=true'
{"error":"not_found","reason":"deleted"}
➜ ~ curl -g 'localhost:5984/db1/doc1?latest=true&open_revs=["1-967a00dff5e02add41819138abb3284d"]' -sv
* Adding handle: conn: 0x7ff32b003a00
* Adding handle: send: 0
* Adding handle: recv: 0
* Curl_addHandleToPipeline: length: 1
* - Conn 0 (0x7ff32b003a00) send_pipe: 1, recv_pipe: 0
* About to connect() to localhost port 5984 (#0)
* Trying ::1...
* Trying 127.0.0.1...
* Connected to localhost (127.0.0.1) port 5984 (#0)
> GET /db1/doc1?latest=true&open_revs=["1-967a00dff5e02add41819138abb3284d"] HTTP/1.1
> User-Agent: curl/7.30.0
> Host: localhost:5984
> Accept: */*
>
< HTTP/1.1 200 OK
< Transfer-Encoding: chunked
* Server CouchDB/1.6.0+build.e7fdc16 (Erlang OTP/R14B01) is not blacklisted
< Server: CouchDB/1.6.0+build.e7fdc16 (Erlang OTP/R14B01)
< Date: Thu, 30 Jan 2014 14:27:09 GMT
< Content-Type: multipart/mixed; boundary="f2910c72f898c936e5732ed95295b4fc"
<
--f2910c72f898c936e5732ed95295b4fc
Content-Type: application/json
{"_id":"doc1","_rev":"2-eec205a9d413992850a6e32678485900","_deleted":true}
* Connection #0 to host localhost left intact
--f2910c72f898c936e5732ed95295b4fc--%
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment