var crypto = require('crypto'); var fs = require('fs'); var url = require('url'); var config = JSON.parse(fs.readFileSync('config.json')); var request = require('request'); var parsedUrl = url.parse(config.url); var hash = crypto.createHash('sha256').update(config.password).digest('hex'); var cookie = 'password='+hash var options = { url: config.url, headers: { "Cookie": cookie } }; function result(error, response, body) { if (!error && response.statusCode == 200) { var results = JSON.parse(body); console.log(body); } } request(options, result);