How to read body from an http respone?


i trying read body http response:


code: [select]
client.print(string("get ") + url + " http/1.1\r\n" +
               "host: " + host + "\r\n" +
               "connection: close\r\n\r\n");


and read response this:


   
code: [select]
while(client.available()){
   
    string line = client.readstringuntil('\r');
    serial.println(line);
   
  }


this works , return this:

requesting url: /output/****.csv?colors=11
http/1.1 200 ok
access-control-allow-origin: *
access-control-allow-headers: x-requested-with
content-type: text/plain
transfer-encoding: chunked
date: sat, 17 jun 2017 08:09:31 gmt
connection: close
set-cookie: serverid=; expires=thu, 01-jan-1970 00:00:01 gmt; path=/
cache-control: private

34
colors,day,timestamp
11,12,2017-06-17t07:48:10.619z


0

but want body  :'(  can me please?

i suggest try arduinohttpclient library: https://github.com/arduino-libraries/arduinohttpclient


Arduino Forum > Products > WiFi Shield 101 (Moderator: cmaglie) > How to read body from an http respone?


arduino

Comments

Popular posts from this blog

Flip address is out of range arduino uno r3

Arduino Uno not uploading

Indesign and MathType fonts