Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tag: v0.1.0
Fetching contributors…

Cannot retrieve contributors at this time

130 lines (85 sloc) 2.738 kb


Speak HTTP like a local


$ http-console>> GET /

HTTP/1.1 200 OK
Date: Mon, 31 May 2010 04:43:39 GMT
Content-Type: text/plain;charset=utf-8
Content-Length: 41

    couchdb: "Welcome",
    version: "0.11.0"


$ npm install http-console


Let's assume we have a CouchDB instance running locally.


To connect, we run http-console, passing it the server host and port as such:

$ http-console 

To have line-editing and command history, we can run it through rlwrap:

$ rlwrap http-console


Once connected, we should see the http prompt:>

server navigation is similar to directory navigation, except a little simpler:> /logs> /46> ..> ..>


HTTP requests are issued with the HTTP verbs GET, PUT, POST, HEAD and DELETE, and a relative path:> GET /
HTTP/1.1 200 OK
Date: Mon, 31 May 2010 04:43:39 GMT
Content-Length: 41

    couchdb: "Welcome",
    version: "0.11.0"
}> GET /bob
HTTP/1.1 404 Not Found
Date: Mon, 31 May 2010 04:45:32 GMT
Content-Length: 44

    error: "not_found",
    reason: "no_db_file"

When issuing POST and PUT commands, we have the opportunity to send data too:> /rabbits> POST
... {"name":"Roger"}

HTTP/1.1 201 Created
Date: Mon, 31 May 2010 05:09:15 GMT
Content-Length: 95

    ok: true,
    id: "2fd9db055885e6982462a10e54003127",
    rev: "1-0c3db91854f26486d1c3922f1a651d86"

Note that POST / is equivalent to just POST. This applies to all methods.

setting headers

Sometimes, it's useful to set HTTP headers:> Accept: application/json> X-Lodge: black

These headers are sent with all requests in this session. To see all active headers, run the \headers command:> \headers
Accept: application/json
X-Lodge: black

Removing headers is just as easy:> Accept:> \headers
X-Lodge: black



nuff' said.

Jump to Line
Something went wrong with that request. Please try again.