I am using the following function to grab the contents of a web page but would like to make it get rid of all the header data before returning. Dose any one have a simple way of doing this? I only am trying to get the contents of the page it self. None of the other junk.
String FetchWebUrl(String URLtoGet)
{
String str;
String ServerToConnectTo;
String PageToGet;
ServerToConnectTo = URLtoGet.substring(0, URLtoGet.indexOf("/"));
PageToGet = URLtoGet.substring(URLtoGet.indexOf("/"));
Serial.println(ServerToConnectTo);
Serial.println(PageToGet);
WiFiClient client;
if (client.connect(ServerToConnectTo.c_str() , 80))
{
client.print(String("GET " + PageToGet + " HTTP/1.1\r\nHost: " + ServerToConnectTo + "\r\n\r\n"));
delay(100);
str = "";
while (client.available())
{
str += String((const char)client.read());
delay(0);
}
return str;
}
return "";
}
http://esp8266basic.com
A BASIC interpreter for your ESP
Working now on Autodrop3d. A 3d printer with automatic part ejection system. https://autodrop3d.com