Query using curl.
curl -XGET http://localhost:9200/users/_search?pretty=true -H 'Content-Type: application/json' -d '
{
"from" : 0, "size" : 5,
"query" : {
"query_string" : {
"query" : "Port"
}
}
}
'
Same thing i am trying to do in python requests:
url = f'{URL}/{INDEX}/_search/'
es_query = {
"query" : {
"query_string" : {
"query" : "Port"
}
}
}
res = requests.get(url, data=es_query)
print(res.json())
I am getting below error while doing this.
`{'error': 'Content-Type header [application/x-www-form-urlencoded] is not supported', 'status': 406}`
Please take a look what can be the issue