We are going to attempt to hit the CouchDB service on our machine by using the command line utility cURL
(we'll spell it curl
from here on out for the sake of simplicity) that allows you to make raw HTTP requests. curl
is our main method of communication with CouchDB. Let's start with a curl
statement to talk to CouchDB.
1. Open Terminal.
2. Run the following statement to create a request that will hit CouchDB:
curl http://127.0.0.1:5984/
3. Terminal will reply with the following:
{"couchdb":"Welcome","version":"1.0.2"}
We just used curl
to communicate with the CouchDB service by issuing a GET
request. By default, curl
will assume that we're trying to issue a GET
request unless we tell it otherwise. We issued our curl
statement to http://127.0.0.1:5984
. Breaking this resource down into pieces, http://127.0.0.1
is the IP of our local computer, and 5984
is the port that CouchDB runs on by default.