Как использовать AUTH в вызове API REST
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