elecfreaks / pxt-esp8266iot

https://elecfreaks.github.io/pxt-esp8266iot/
MIT License
3 stars 31 forks source link

Library does not set the content-type header when writing data to ThingSpeak #5

Open v-c opened 20 hours ago

v-c commented 20 hours ago

See the definition here: https://github.com/elecfreaks/pxt-esp8266iot/blob/2ac4ed8b500eb9a233413c009f80bdd7bede96d1/ESP8266.ts#L236

It does not set the "Content-Type" header, which is required by ThingSpeak per their documentation. Without this header, the channel is not updated.

I believe the library needs something similar to this to be set:

AT+HTTPPARA="CONTENT","application/x-www-form-urlencoded"

v-c commented 20 hours ago

CC: @elecfreaks1 @waltfe