I would like to know how to convert a cURL command into a python request. Indeed, I am using this cURL command :
curl -i -XPOST 'http://localhost:8086/write?db=mydb' --data-binary 'air_quality,host=raspberrypi value=200'
So, it allows to write the value 200 in the database mydb. But I would like to put this command in a python script. Then, it's not possible to do it, I got a format error.
I think it is possible to do it with python but I don't know how exactly. First, I have to import that :
import requests
Then the command should be like that :
requests.post("htp://localhost:8086/write?db=mydb air_quality,host=raspberrypi value="+str(sensor_value))
My question is : how to write correctly the previous line for the python request ? This a screenshot of my error : Troubleshooting