How to filter all those HTTP headers in a GET response
Posted: Sun Nov 15, 2015 8:04 pm
Hi everyone,
I'm using native Arduino code (not the AT firmware) compiled with the Arduino IDE for ESP 8266.
I was hoping to get some advice on How to filter all those HTTP headers in a GET response which arrive from the web server. I really only need the value for which I am seeding the GET request in the first place but instead my ESP 8266 is filling up its incoming array with headers and only at the end I see the value of interest.
For example here is what the API at Thingspeak responds with to a GET request:
The value I am looking for follows once the header mess is sent back to the client (my esp 8266).
If I have to dig into string search business so be it but somehow I was hoping there is a way to suppress the headers in Thinkspeak's response?
Thanks
I'm using native Arduino code (not the AT firmware) compiled with the Arduino IDE for ESP 8266.
I was hoping to get some advice on How to filter all those HTTP headers in a GET response which arrive from the web server. I really only need the value for which I am seeding the GET request in the first place but instead my ESP 8266 is filling up its incoming array with headers and only at the end I see the value of interest.
For example here is what the API at Thingspeak responds with to a GET request:
Code: Select all
OST data to URL: /apps/thinghttp/send_request?api_key=LKGQ123123123121
HTTP/1.1 200 OK
Content-Type: text/html; charset=utf-8
Transfer-Encoding: chunked
Connection: close
Status: 200 OK
X-Frame-Options: ALLOWALL
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: GET, POST, PUT, OPTIONS, DELETE, PATCH
Access-Control-Allow-Headers: origin, content-type, X-Requested-With
Access-Control-Max-Age: 1800
ETag: "f7635f54b0bd41fb88a1bf6d98af3c5f"
Cache-Control: max-age=0, private, must-revalidate
X-Request-Id: 32432325324-10aa-42e6-12312141323412312
X-Runtime: 0.267168
X-Powered-By: Phusion Passenger 4.0.57
Date: Mon, 16 Nov 2015 00:59:48 GMT
Server: nginx/1.9.3 + Phusion
The value I am looking for follows once the header mess is sent back to the client (my esp 8266).
If I have to dig into string search business so be it but somehow I was hoping there is a way to suppress the headers in Thinkspeak's response?
Thanks