I am using AWS HttpClient handleRequest
inside a lambda function written in Node.Js using aws sdk
to Search ElasticSearch url. I am following the AWS Documentation.
https://docs.amazonaws.cn/en_us/elasticsearch-service/latest/developerguide/es-request-signing.html
Please have a look at the code block below. In that one the console log logs only {} and the handle Request method is not being called at all.
var client = new AWS.HttpClient();
//logs only {}
console.log("client", client);
//Not being called and no logs at all
client.handleRequest(request, null, function(response) {
console.log(response.statusCode + ' ' + response.statusMessage);
var responseBody = '';
response.on('data', function (chunk) {
responseBody += chunk;
});
response.on('end', function (chunk) {
console.log('Response body: ' + responseBody);
});
}, function(error) {
console.log('Error: ' + error);
});
}