@@ -400,11 +400,26 @@ Ticker sendHTTPRequest(sendRequest, HTTP_REQUEST_INTERVAL_MS, 0, MILLIS);
400400
401401void sendRequest(void)
402402{
403+ static bool requestOpenResult;
404+
403405 if (request.readyState() == readyStateUnsent || request.readyState() == readyStateDone)
404406 {
405- //request.open("GET", "http://worldtimeapi.org/api/timezone/Europe/London.txt ");
406- request.open("GET", "http://worldtimeapi.org/api/timezone/America/Toronto.txt ");
407- request.send();
407+ //requestOpenResult = request.open("GET", "http://worldtimeapi.org/api/timezone/Europe/London.txt ");
408+ requestOpenResult = request.open("GET", "http://worldtimeapi.org/api/timezone/America/Toronto.txt ");
409+
410+ if (requestOpenResult)
411+ {
412+ // Only send() if open() returns true, or crash
413+ request.send();
414+ }
415+ else
416+ {
417+ Serial.println("Can't send bad request");
418+ }
419+ }
420+ else
421+ {
422+ Serial.println("Can't send request");
408423 }
409424}
410425
@@ -587,6 +602,7 @@ IPAddress ip(192, 168, 2, 232);
587602
588603```
589604Start AsyncHTTPRequest_STM32 on NUCLEO_F767ZI
605+ AsyncHTTPRequest_Generic v1.1.1
590606AsyncHTTPRequest @ IP : 192.168.2.72
591607
592608**************************************
@@ -631,6 +647,7 @@ week_number: 37
631647
632648```
633649Starting AsyncHTTPRequest_ESP_WiFiManager using LittleFS on ESP8266_NODEMCU
650+ AsyncHTTPRequest_Generic v1.1.1
634651Stored: SSID = HueNet1, Pass = 12345678
635652Got stored Credentials. Timeout 120s
636653ConnectMultiWiFi in setup
@@ -663,6 +680,7 @@ HHHHHH
663680
664681```
665682Starting AsyncHTTPRequest_ESP_WiFiManager using SPIFFS on ESP32_DEV
683+ AsyncHTTPRequest_Generic v1.1.1
666684Stored: SSID = HueNet1, Pass = 12345678
667685Got stored Credentials. Timeout 120s
668686ConnectMultiWiFi in setup
@@ -713,6 +731,7 @@ HHHHHHHHH HHHHHHHHHH HHHHHHHHHH
713731
714732```
715733Starting AsyncHTTPRequest_ESP using ESP8266_NODEMCU
734+ AsyncHTTPRequest_Generic v1.1.1
716735Connecting to WiFi SSID: HueNet1
717736...........
718737HTTP WebServer is @ IP : 192.168.2.81
@@ -744,6 +763,7 @@ HHHHHHHHH HHHHHHHHHH HHHHHHHHHH H
744763
745764```
746765Start AsyncWebClientRepeating_STM32 on NUCLEO_F767ZI
766+ AsyncHTTPRequest_Generic v1.1.1
747767AsyncHTTPRequest @ IP : 192.168.2.72
748768
749769**************************************
0 commit comments