The params parameter is not intended to send data. If you are trying to send data to a server, you should use the data parameter. If you are trying to send request parameters, you should not encode their JSON and just specify the parameters as a dict.
I suspect your first request should be as follows:
r = requests.get(uri, data=es_query)
And before someone makes me head over heels, yes, the HTTP / 1.1 specification allows you to send data using GET requests, and yes requests support it.
Ian Stapleton Cordasco
source share