Closed berlin2 closed 5 years ago
It's actually very simple:
final awsSigV4Client = new AwsSigV4Client('xxx', 'xxx/', endpoint, serviceName: 'es', sessionToken: 'xxx', region: 'us-east-2');
final query = {
'query': {
'bool': {
'must': {
'match': {'any': 'data'}
}
}
}
};
final signedRequest = new SigV4Request(awsSigV4Client,
method: 'POST',
path: '/my-index/test-type/_search',
headers: new Map<String, String>.from(
{'Content-Type': 'application/json; charset=utf-8'}),
body: query);
http.Response response;
try {
response = await http.post(signedRequest.url,
headers: signedRequest.headers, body: signedRequest.body);
} catch (e) {
print(e);
}
print(response.body);
Great library! Please provide an example on signing an ElasticSearch and a DynamoDB request.