1
Good personal day I am with following problem, I have an API to be consumed, but it expects a return token validated internally, this token is passed as parameter via header, but I do not use JWT, I take a token generated by the bank. My question is precisely how to send via header this value, to make the API receive. I’ve never done this process, the code I have today is this.
application.get('/listarEmpresas', function(req, res) {
var request = require('request');
request('APIURL', function(error, response, body) {
console.log('error:', error);
let url = req.url
console.log('statusCode:', response && response.statusCode);
console.log('body:', body);
var arrayJSON = JSON.parse(body);
});
});
I’d be grateful if anyone could shed some light.
Good morning Sorack, thank you for that teaching, it worked perfectly!.
– Roberto
@Roberto The answer helped solve the problem and can solve similar questions of other users? If positive do not forget to mark as accepted. To do this just click on the left side of it (below the indicator of up and down votes).
– Sorack