Can someone help with this code. When I pass a "post" request with basic auth status is 200 but nothing comes in response.With out auth the same code works
let username = 'username';
let password = 'password';
let headers = new Headers();
headers.set('Authorization', 'Basic ' + base64.encode(username + ":" + password));
fetch('https://sandbox.transactions.com', {
method: 'post',
body: JSON.stringify(body),
headers: headers
})
.then(function(response) {
return response.json();
}).then(function(json) {
console.log(json);
}).catch(function(err) {
console.log('There is an error ');
res.status(500).send('There was an error while fetching');
});