Created
December 9, 2016 15:17
-
-
Save bekatom/1c3023ce14e57be49da516b63862b9d4 to your computer and use it in GitHub Desktop.
couchdb_authentication.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var request = require("request"); | |
var options = { method: 'POST', | |
url: 'http://couchbase_host:4984/dbname/_session', | |
headers: | |
{ 'postman-token': '655ec530-e665-6bdf-ac52-2bcf62ff14ab', | |
'cache-control': 'no-cache', | |
'content-type': 'application/json' }, | |
body: { name: 'username', password: 'password' }, | |
json: true }; | |
request(options, function (error, response, body) { | |
if (error) throw new Error(error); | |
console.log(body); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment