- 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.
推薦閱讀
- 自己動手寫搜索引擎
- Rust編程:入門、實戰(zhàn)與進階
- Java高并發(fā)核心編程(卷2):多線程、鎖、JMM、JUC、高并發(fā)設(shè)計模式
- 差分進化算法及其高維多目標(biāo)優(yōu)化應(yīng)用
- Apache Spark 2.x for Java Developers
- RESTful Java Web Services(Second Edition)
- C++20高級編程
- OpenMP核心技術(shù)指南
- Visual Basic程序設(shè)計全程指南
- Oracle 12c從入門到精通(視頻教學(xué)超值版)
- ArcPy and ArcGIS(Second Edition)
- Java語言程序設(shè)計實用教程(第2版)
- Koa與Node.js開發(fā)實戰(zhàn)
- Learning Redux
- Puppet Cookbook(Third Edition)