Python : curl command option with -d
to python
I have the following curl
bash script that returns multiple lines in terminal.
curl 'http://localhost/_search?pretty' -d '
{
"query" :{
"range" : {
"created_at" : {
"gte": "now-2h",
"lte": "now"
}
}
}
}'
I want to run this bash script or curl
command in python and receive the output in python. What should I do? requests
does not seem to support options for curl
command.