-->
Page 2 of 2

Re: Help getting/using wifi data through JSON

PostPosted: Thu Apr 14, 2016 7:44 am
by martinayotte
Here is some untested snippet of code derived from your own code :

Code: Select all  // Read all the lines of the reply from server and print them to Serial
  String body = "";
  bool headerComplete = false;
  while(client.available()){
    String line = client.readStringUntil('\r');
    if (headerComplete) {
      body += line;
    }
    if (line.length() < 2) { // line seems to be empty, although it can have a single \n
      headerComplete = true;
    }
  }
  Serial.print(body); // this should print only the body containing the JSON