-->
Page 1 of 1

how to work with web responce?

PostPosted: Sun Mar 20, 2016 12:36 pm
by kamal sonani
example:-
i just request to thing-speak with their API>>https://api.thingspeak.com/apps/thinghttp/send_request?api_key=81SKXERE6TPG8XOY

i receive response in html format.
then how i work with them ?
mean if i receive (down below data) i want to filter numbers and remove semicolons and many more....so first of all where i store whole data that i receive from internet?

<html><head><style type="text/css"></style></head><body><span class="about-stat"><b>213,970</b> subscribers</span>
<span class="about-stat"> • <b>13,525,579</b> views</span>
<br>
<span class="about-stat">Joined Oct 2, 2013</span>
</body></html>

Re: how to work with web responce?

PostPosted: Tue Mar 22, 2016 9:39 am
by nemik
That will probably be a bit difficult to parse in C without a full XML library, which probably wouldn't fit.

Is there a way to get a JSON response? If you can find it, definitely check out the 'jsmn' JSON parsing library, it works very nicely on the ESP8266. There's a tutorial for it here: https://alisdair.mcdiarmid.org/jsmn-example/

Re: how to work with web responce?

PostPosted: Wed Mar 23, 2016 12:59 am
by kamal sonani
thanks for replay>>

but let me re-explain you, when i request any server like
:-"GET /apps/thinghttp/send_request?api_key=81SKXERE6TPG8XOY"
:-host"https://api.thingspeak.com"
:-port"80"

i receive data in html OR xml format (i found that esp8266 is transmit this data on serial line).
and here is what i'm try to ask community if esp8266 request to server and server feed response to esp8266 than where is the data(BUFFER) store actually?

after that esp8266 trancemitt that data back on my PC's serial window.

this time i just work with external arduino and find the data between string and just work with them. like any number or temperature or any kind of them.


but i want this done by only esp8266 therefor i want to know about my question.