HTML problems Part Deux

Well thanks to Danois90 and others I got the bad request error to go away, but I still can’t much data beyond 25 bytes to write into HTMLine as it reads. It seems to read the header lines as shown from

Start of read from server

till

End of read from server

Including the 25 bytes from the start of { as I want for the JSON reader thing to deal with in the next section, but that’s it.

What is stopping it from reading all 16717 bytes that are supposedly there? Is something just timing out too early. Strange.

09:14:05.754 -> >>>Start of read from server
09:14:05.754 -> HTTP/1.1 200 OK
09:14:05.754 -> Date: Sun, 04 Oct 2020 14:14:05 GMT
09:14:05.754 -> Content-Type: application/json; charset=utf-8
09:14:05.754 -> Content-Length: 16717<------------------NOTE THE LENGTH HERE
09:14:05.754 -> Connection: keep-alive
09:14:05.790 -> Set-Cookie: __cfduid=dad16f87edb3600eec83535bf74d9f9ab1601820845; expires=Tue, 03-Nov-20 14:14:05 GMT; path=/; domain=.newsapi.org; HttpOnly; SameSite=Lax
09:14:05.790 -> Cache-Control: no-cache
09:14:05.790 -> Pragma: no-cache
09:14:05.790 -> Expires: -1
09:14:05.790 -> X-Cached-Result: false
09:14:05.790 -> CF-Cache-Status: DYNAMIC
09:14:05.790 -> cf-request-id: 05958f7e0700007e615f1b0200000001
09:14:05.790 -> Server: cloudflare
09:14:05.790 -> CF-RAY: 5dcf81dc8a477e61-DTW
09:14:05.790 -> 
09:14:05.790 -> {"status":"ok","totalResu>>>End of read from server
09:14:05.790 -> charcounter= 25 <------------------NUMBER OF BYTES READ INTO HTMLine
09:14:05.824 -> 
09:14:05.824 -> ***Start read data saved to HTMLine
09:14:05.824 -> {"status":"ok","totalResu
09:14:05.824 -> ***End read data saved to HTMLine

This is the section that handles wifi to read newsapi.org

void NewsStuff() {
  if (millis() > NewsTime) {
    NewsTime = millis() + NewsInterval;
    const char *Newshost = "newsapi.org";
    const uint16_t port = 80;
    WiFiClient client;
    client.connect(Newshost, port);
    if (!client.connect(Newshost, port)) {
      Serial.println("connection failed");
      delay(5000);
      return;
    }
    if (client.connected()) {
      client.println("GET http://newsapi.org/v2/top-headlines?country=us&category=business&apiKey=d6a79f90abf5430b14543a5536c7760c HTTP/1.1");
      client.println("Host: newsapi.org");
      client.println("");
      client.println("");
    }
    unsigned long timeout = millis();
    while (client.available() == 0) {
      if (millis() - timeout > 5000) {
        Serial.println(">>> Client Timeout !");
        client.stop();
        delay(1000);
        return;
      }
    }
    Serial.println();
    Serial.println(">>>Start of read from server");
    charcounter = 0;
    bool braceopen = false;
    while (client.available()) {
      char c = client.read();
      Serial.print(c);
      if (c == '{') braceopen = true;
      if (charcounter < HTMLineLength && braceopen) {
        HTMLine[charcounter] = c;
        charcounter += 1;
      }
    }
    Serial.println(">>>End of read from server");
    Serial.print("charcounter= ");   Serial.println(charcounter);
    Serial.println();
    Serial.println("***Start read data saved to HTMLine");
    Serial.println(HTMLine);
    Serial.println("***End read data saved to HTMLine");
    FilterData();
  }
}