Hi All,
In the ESP8266 micropython documentation http get function is mentioned, however I want http post function to upload sensor values through thingspeak api. how can I do it ?
HTTP post function
Re: HTTP post function
Try out this urequests library: https://github.com/micropython/micropyt ... equests.py. It supports POST requests and should allow you to specify anything else you might need for headers and such.
Re: HTTP post function
Thanks Chris !
Where in the Code I need to mention API key.. ? I'm getting response codes but unable to put/post data as I'm not sure where to include API keys.
Where in the Code I need to mention API key.. ? I'm getting response codes but unable to put/post data as I'm not sure where to include API keys.
Re: HTTP post function
I'm not familiar with the Thingspeak API but they probably want to you specify it as a header. You would accomplish this by adding a argument to your call to POST, like headers={"API-KEY":"MyAPIKey"}, assuming the name of the header they want is API-KEY and the value of your API Key is MyAPIKey. You'll have to check their docs to see how they expect the key to be supplied.