- CouchDB and PHP Web Development Beginner’s Guide
- Tim Juravich
- 156字
- 2021-08-13 18:22:52
Time for action — getting a list of all databases in CouchDB
You've seen a GET
request earlier in this book when we used the curl
statement: curl http://localhost:5984
.
This time, let's issue a GET
request to access CouchDB and get a list of all of the databases on the server.
- Run the following command in Terminal:
curl -X GET http://localhost:5984/_all_dbs
- Terminal will respond with the following:
["_users"]
What just happened?
We used Terminal to trigger a GET
request to CouchDB's RESTful JSON API. We used one of the options: -X
, of curl
, to define the HTTP method. In this instance, we used GET. GET
is the default method, so technically you could omit -X
if you wanted to. Once CouchDB processes the request, it sends back a list of the databases that are in the CouchDB server. Currently, there is only the _users
database, which is a default database that CouchDB uses to authenticate users.
推薦閱讀
- Computer Vision for the Web
- Learning Chef
- Python for Secret Agents:Volume II
- 體驗設計原理:行為、情感和細節
- 趣學Python算法100例
- Python計算機視覺編程
- Easy Web Development with WaveMaker
- Yii Project Blueprints
- 愛上micro:bit
- 深入剖析Java虛擬機:源碼剖析與實例詳解(基礎卷)
- Java EE企業級應用開發教程(Spring+Spring MVC+MyBatis)
- Puppet:Mastering Infrastructure Automation
- 計算機應用基礎案例教程(第二版)
- Java程序設計入門(第2版)
- Vue.js 3.x高效前端開發(視頻教學版)