In this exercise, we'll issue a PUT
request, which will create a new database in CouchDB.
1. Create a new database by running the following command in Terminal:
curl -X PUT http://localhost:5984/test-db
2. Terminal will respond with the following:
{"ok":true}
3. Try creating another database with the same name by running the following command in Terminal:
curl -X PUT http://localhost:5984/test-db
4. Terminal will respond with the following:
{"error":"file_exists","reason":"The database could not be created, the file already exists."}
5. Okay, that didn't work. So let's to try to create a database with a different name by running the following command in Terminal:
curl -X PUT http://localhost:5984/another-db
6. Terminal will respond with the following:
{"ok":true}
7. Let's check the details of the
test-db
database quickly and see more detailed information about it. To do that, run the following command in Terminal:curl -X GET http...