O'Reilly logo

CouchDB and PHP Web Development Beginner's Guide by Tim Juravich

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Time for action — creating a database for Verge with curl

We created a database using curl in Chapter 3, Getting Started with CouchDB and Futon. Let's quickly recap how to use a PUT request to create a new database in CouchDB.

  1. Create a new database by running the following command in Terminal. Make sure to replace username and password with the database administrator user that you created in Chapter 3.
    curl -X PUT username:password@localhost:5984/verge
    
    
  2. Terminal will respond with the following output:
    {"ok":true}
    
    

What just happened?

We used Terminal to trigger a PUT request, using curl, to create a database through CouchDB's RESTful JSON API. We passed verge as the name of the database at the end of CouchDB's root URL. When the database was successfully ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required