- Tue May 29, 2018 1:04 pm
#76152
Hi, I am new with the ESP8266 and I am working in some projects where I need to read the response from a web site, I achieve connect the esp8266 to the WiFi and if I use this host = "example.com", it works but if I use this one host: "example.com/configuration/execution"; it doesnt work I mean it doesnt achieve the connection to the host, Does someone know why I cant connect to that host? if it is not possible or if I am doing something wrong?
const char* hostinfo = "example.com/configuration/execution";
Serial.print("connecting to ");
Serial.println(host);
// Use WiFiClient class to create TCP connections
WiFiClient client;
const int httpPort = 80;
if (!client.connect(host, httpPort)) {
Serial.println("connection failed");
return;
}