January 29, 2018
Hi, I am new to Thingspeak and I am now struggling with the ThingHTTP.
I am sending a http get request to receive data for my ESP8266. So far, everything is working perfectly well. My problem is that I need the data in the json format. Where can I specify, that thingspeak gives me a json format back to my get request? What do I have to type into the "Content Type:" field?
Thanks for your help
March 7, 2017
Generally the HTTP requests end in the format you need (before the parameters). Thingspeak supports JSON and XML for most endpoints. Some of them also support TXT and CSV.
https://api.thingspeak.com/channels/12345678910/feeds.json?api_key=XXXXXXXXXXXXXXXX&results=2 will return 2 results from a private channel in JSON format.
https://api.thingspeak.com/channels/987654321/fields/6.xml?days=2&location=true will return 2 days of results from field 6 of channel 987654321 (up to 8000 entries) and include location information, as long as the channel is public.
For GET requests, you do not need content type. If you need to include that header, you can usually specify application/x-www-form-urlencoded unless you are using Bulk Update. Have a look at the REST API documentation for more info.
Most Users Ever Online: 114
Currently Browsing this Page:
Guest Posters: 1
Newest Members:terranceqh2, DianeEmids, Alanawaype, uqovitay, ufijifode, manish01
Administrators: Hans: 387, lee: 457