I am using botocore's AWSRequest to make calls to Elasticsearch cluster. I am using GET method on an index with _search API as follows:
req = AWSRequest(method=method, url=proto + host + urllib.parse.quote(path), data=payload,
headers={'Host': host, 'Content-Type': 'application/json'})
path is in the following format:
/<Document-Index>/_search?q=param:param-val
I am using:
SigV4Auth(creds, 'es', region).add_auth(req)
http_session = URLLib3Session()
res = http_session.send(req.prepare())
to make the GET call to the Elastic search endpoint. I am getting the foillowing error:
Incorrect HTTP method for uri [/<Document-Index>/_search?<query_terms>] and method [GET], allowed: [POST]",
status: 405
Can anyone help me with this?
Thanks
and method [GET], allowed: [POST], can you try changing it ?