Serial.print("connecting to ");
//
Use WiFiClient class to create TCP connections
if (!client.connect(host, httpPort)) {
Serial.println("connection failed");
//
We now create a URI for the request
Serial.print("Requesting URL: ");
//
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 > 5000) {
Serial.println(">>> Client Timeout !");
//
Read all the lines of the reply from server and print them to Serial
while(client.available()){