How do i remove the header tag from a http get?(using esp8266)

Hi

So guys i want to remove the header info which i get when i use the http Get functions to retrieve data from my database any ideas?

this is the header i want to remove:

Connecting to nope
........
WiFi connected
IP address: 
nope
connecting to nope
HTTP/1.1 200 OK

(what i want to remove) 
{
Date: Mon, 18 Feb 2019 14:26:40 GMT
Content-Type: text/html; charset=UTF-8
Transfer-Encoding: chunked
Connection: close
Server: awex
X-Xss-Protection: 1; mode=block
X-Content-Type-Options: nosniff
X-Request-ID: 8ded25a20dd46b05a03f8e80095e1f4a
}


(My Values)

Here is my code which is uploaded to the esp

#include <ESP8266WiFi.h>

const char* ssid     = "nope"; //Wi-Fi SSID
const char* password = "nope"; //Wi-Fi Password

//Server IP or domain name
const char* host = "nope.com";

void setup() {
  Serial.begin(115200);
  delay(10);

  Serial.println();
  Serial.println();
  Serial.print("Connecting to ");
  Serial.println(ssid);
  WiFi.begin(ssid, password); //Connecting to the network
  
  while (WiFi.status() != WL_CONNECTED) { //Wait till connects
    delay(500);
    Serial.print(".");
  }

  Serial.println("");
  Serial.println("WiFi connected");  
  Serial.println("IP address: ");
  Serial.println(WiFi.localIP()); //to know the IP
}

void loop() {
  delay(5000);

  Serial.print("connecting to ");
  Serial.println(host);
  
  WiFiClient client; //Client to handle TCP Connection
  const int httpPort = 80;
  if (!client.connect(host, httpPort)) {
    Serial.println("connection failed");
    return;
  }
  
  // We now create a URI for the request
  String url = "nope"; //File or Server page i want to communicate with along with data
  
  // This will send the request to the server 
  client.print(String("GET ") + url + " HTTP/1.1\r\n" +
               "Host: " + host + "\r\n" + 
               "Connection: close\r\n\r\n");
  unsigned long timeout = millis();
  while (client.available() == 0) {
    if (millis() - timeout > 25000) { //Try to fetch response for 25 seconds
      Serial.println(">>> Client Timeout !");
      client.stop();
      return;
    }
  }
  
  // Read all the lines of the reply from server and print them to Serial
  while(client.available()){
    String line = client.readStringUntil('\r');
     Serial.print(line);
  }
  Serial.println();
  Serial.println("closing connection");
  client.stop(); //Close Connection
}
  while(client.available()){
    String line = client.readStringUntil('\r');
     Serial.print(line);
  }

Each time that there is still data available from the server, create a local variable to contain one line of the response, print it, and watch it immediately go up in smoke.

When the while loop is done, you have NOTHING to prove that it ever ran.

THAT is the first thing you have to correct.

It appears that you are only interested in the last record from the server, so if you make line a global variable, it will, when the while loop is done, contain the last record from the server.

Print line again after the while loop ends, and you'll see that there is nothing to remove.

Wait until you receive a sequence of "\r\n\r\n" which marks the end of the http header. Then you can store the content into a buffer.