Skip to content

Instantly share code, notes, and snippets.

@bekatom
Created December 9, 2016 15:17
Show Gist options
  • Save bekatom/1c3023ce14e57be49da516b63862b9d4 to your computer and use it in GitHub Desktop.
Save bekatom/1c3023ce14e57be49da516b63862b9d4 to your computer and use it in GitHub Desktop.
couchdb_authentication.js
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