client.print(String("POST ") + url + " HTTP/1.1\r\n" +
"Host: " + host + "\r\n" +
"Content-Type: application/json\r\n" +
"User-Agent: BuildFailureDetectorESP8266\r\n" +
"Content-Length: 0\r\n" +
"X-AIO-Key: "MY_KEY"\r\n" +
"Connection: close\r\n\r\n");
I have been using the above to POST my data. I am not sure where do I need to put the Body so as to store my value.
I tried to put it as below bu did not work.
"Connection: close\r\n\r\n{\"value\" :\"ON\"}");
I get the below error when I make an HTTP request.
"error": "request failed - failed to save data to feed 51jj. param is missing or the value is empty: datum"
USING POST REQUEST USING ADAFRUIT..IO API
Moderators: adafruit_support_bill, adafruit
Forum rules
If you're posting code, please make sure your code does not include your Adafruit IO Active Key or WiFi network credentials.
If you're posting code, please make sure your code does not include your Adafruit IO Active Key or WiFi network credentials.
- rk_ramkishor
- Posts: 1
- Joined: Wed Mar 31, 2021 8:11 am
- brubell
- Learn User Page
- Posts: 2010
- Joined: Fri Jul 17, 2015 10:33 pm
Re: USING POST REQUEST USING ADAFRUIT..IO API
Are you following an example from somewhere?
Forum rules
If you're posting code, please make sure your code does not include your Adafruit IO Active Key or WiFi network credentials.
If you're posting code, please make sure your code does not include your Adafruit IO Active Key or WiFi network credentials.