Skip to content

Instantly share code, notes, and snippets.

@dscape
Created August 19, 2011 20:35
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 dscape/a98cdc65b06b10554080 to your computer and use it in GitHub Desktop.
Save dscape/a98cdc65b06b10554080 to your computer and use it in GitHub Desktop.
Strange behavior in request
curl -v http://testnano.iriscouch.com:80/test
* About to connect() to testnano.iriscouch.com port 80 (#0)
* Trying 50.16.186.4... connected
* Connected to testnano.iriscouch.com (50.16.186.4) port 80 (#0)
> GET /test HTTP/1.1
> User-Agent: curl/7.19.7 (universal-apple-darwin10.0) libcurl/7.19.7 OpenSSL/0.9.8r zlib/1.2.3
> Host: testnano.iriscouch.com
> Accept: */*
>
< HTTP/1.1 200 OK
< Server: CouchDB/1.1.0 (Erlang OTP/R14B03)
< Date: Fri, 19 Aug 2011 20:35:02 GMT
< Content-Type: text/plain;charset=utf-8
< Content-Length: 209
< Cache-Control: must-revalidate
<
{"db_name":"test","doc_count":0,"doc_del_count":0,"update_seq":0,"purge_seq":0,"compact_running":false,"disk_size":79,"instance_start_time":"1313785038612493","disk_format_version":5,"committed_update_seq":0}
* Connection #0 to host testnano.iriscouch.com left intact
* Closing connection #0
require('request').get("http://testnano.iriscouch.com:80/test", function (e,_,b){console.log(e,b)})
> null '{"db_name":"test","doc_count":0,"doc_del_count":0,"update_seq":0,"purge_seq":0,"compact_running":false,"disk_size":79,"instance_start_time":"1313785038612493","disk_format_version":5,"committed_update_seq":0}\n'
njob$ curl -vX PUT http://testnano.iriscouch.com:80/test
* About to connect() to testnano.iriscouch.com port 80 (#0)
* Trying 50.16.186.4... connected
* Connected to testnano.iriscouch.com (50.16.186.4) port 80 (#0)
> PUT /test HTTP/1.1
> User-Agent: curl/7.19.7 (universal-apple-darwin10.0) libcurl/7.19.7 OpenSSL/0.9.8r zlib/1.2.3
> Host: testnano.iriscouch.com
> Accept: */*
>
< HTTP/1.1 412 Precondition Failed
< Server: CouchDB/1.1.0 (Erlang OTP/R14B03)
< Date: Fri, 19 Aug 2011 20:33:26 GMT
< Content-Type: text/plain;charset=utf-8
< Content-Length: 95
< Cache-Control: must-revalidate
<
{"error":"file_exists","reason":"The database could not be created, the file already exists."}
* Connection #0 to host testnano.iriscouch.com left intact
* Closing connection #0
require('request').put("http://testnano.iriscouch.com:80/test", function (e,_,b){console.log(e,b)})
> null ''
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment