- 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.
推薦閱讀
- Data Visualization with D3 4.x Cookbook(Second Edition)
- 一步一步學Spring Boot 2:微服務項目實戰
- LabVIEW Graphical Programming Cookbook
- Delphi程序設計基礎:教程、實驗、習題
- JavaScript 網頁編程從入門到精通 (清華社"視頻大講堂"大系·網絡開發視頻大講堂)
- Java FX應用開發教程
- Julia機器學習核心編程:人人可用的高性能科學計算
- Building Mapping Applications with QGIS
- Julia Cookbook
- Android開發案例教程與項目實戰(在線實驗+在線自測)
- Windows內核編程
- Swift 4從零到精通iOS開發
- Hands-On Neural Network Programming with C#
- Flink技術內幕:架構設計與實現原理
- Using Yocto Project with BeagleBone Black