Cómo usar Auth in Rest API llamadas
const username = 'username';
const password = 'password';
var request = {
host: endpoint,
method: 'POST',
path: '/_bulk',
body: body,
headers: {
'Content-Type': 'application/json',
'Host': endpoint,
'Content-Length': Buffer.byteLength(body),
'X-Amz-Security-Token': process.env.AWS_SESSION_TOKEN,
'X-Amz-Date': datetime,
},
auth: {
'username': username,
'password': password
}
};
Rizz