const http = require('http'); const options = { hostname: 'localhost', port: 8080, path: '/v1/orders/history', method: 'GET', headers: { 'Authorization': 'Bearer test', 'X-Actor-Id': 'act_admin' } }; const req = http.request(options, res => { console.log(`statusCode: ${res.statusCode}`); let data = ''; res.on('data', d => { data += d; }); res.on('end', () => { console.log(data); }); }); req.on('error', error => { console.error(error); }); req.end();