You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 11, 2022. It is now read-only.
*[Pool size and open sockets](#pool-size-and-open-sockets)
26
28
*[Extending the Cloudant Library](#extending-the-cloudant-library)
27
29
*[Pipes](#pipes)
@@ -33,7 +35,6 @@ This is the official Cloudant library for Node.js.
33
35
*[License](#license)
34
36
*[Reference](#reference)
35
37
36
-
37
38
## Installation and Usage
38
39
39
40
The best way to use the Cloudant client is to begin with your own Node.js project, and define this work as your dependency. In other words, put me in your package.json dependencies. The `npm` tool can do this for you, from the command line:
As shown above, the corresponding database `request`, `headers` and `statusCode` are also returned in the error.
224
272
225
-
*`err` - the error, if any
226
-
*`body` - the http _response body_ from Cloudant, if no error.
227
-
*`header` - the http _response header_ from Cloudant, if no error
273
+
*`body` - The HTTP _response body_ (if no error). For example:
274
+
275
+
```js
276
+
cloudant.db.list(function(err, body, headers) {
277
+
console.log(body);
278
+
});
279
+
```
280
+
281
+
```
282
+
[ '_replicator', '_users' ]
283
+
```
284
+
285
+
*`headers` - The HTTP _response headers_ (if no error). For example:
286
+
287
+
```js
288
+
cloudant.db.list(function(err, body, headers) {
289
+
console.log(headers);
290
+
});
291
+
```
292
+
293
+
```
294
+
{ 'x-couchdb-body-time': '0',
295
+
'x-couch-request-id': '591be401f1',
296
+
'transfer-encoding': 'chunked',
297
+
etag: '"7Q4MT2X8W1RO3JQOLSA4KGMV7"',
298
+
date: 'Fri, 27 Apr 2018 08:49:49 GMT',
299
+
'content-type': 'application/json',
300
+
'cache-control': 'must-revalidate',
301
+
statusCode: 200,
302
+
uri: 'http://localhost:5984/_all_dbs' }
303
+
```
228
304
229
-
The `ping()` function is the only exception to this rule. It does not return headers since a "ping" is made from multiple requests to gather various bits of information.
305
+
Note that the `statusCode` and `uri` and also included amongst the response headers.
0 commit comments