Api call not responding. (nodeMCU)


The website above offers free Timezone APIs. I have been trying to request the API with my esp8266 NodeMCU, but still, i get no response. Can anyone please demonstrate to me with a code sample how it’s supposed to be done? I will be posting my code soon.

The following is my code (In arduino IDE) for my NodeMCU

#include <ESP8266WiFi.h>

String result;
char host=“script.google.com”;
WiFiClient client;
void setup() {
// put your setup code here, to run once:
WiFi.begin(“Faiz”, “hautepackard”);
while(WiFi.status() != WL_CONNECTED){
void loop() {
String url = “/macros/s/AKfycbyd5AcbAnWi2Yn0xhFRbyzS4qMq1VucMVgVvhul5XqS9HkAyJY/exec”;
void Time(){
if (client.connect(host, 443)) { //starts client connection, checks for connection
client.print(String("GET “) + url + " HTTP/1.1\r\n” +
"Host: " + host + “\r\n” +
“Connection: close\r\n\r\n”);
Serial.println(“Server is accessible”);
} else {
Serial.println(“connection failed”); //error message if no client connect
result = “”;
while (client.available()) { //connected or data available
char c = client.read(); //gets byte from ethernet buffer
result = result+c;
client.stop(); //stop client
Serial.println(“end of function”);
And this is what i get in the Serial monitor:

Server is accessible
end of function

Am i going wrong anywhere in the code? Please help this burning question.

Too painful to read ..

use code tags so that it looks like this

// your code here

and indent your code (press ctrl-T in the IDE before pasting here)

(Also you are probably very optimistic if you hope to have the data available for reading a few microseconds after sending the HTTP request... you should read how to handle asynchronous answers)

The website above offers free Timezone APIs.

So, why are you connecting to script.google.com?