@@ -400,11 +400,26 @@ Ticker sendHTTPRequest(sendRequest, HTTP_REQUEST_INTERVAL_MS, 0, MILLIS);
400
400
401
401
void sendRequest(void)
402
402
{
403
+ static bool requestOpenResult;
404
+
403
405
if (request.readyState() == readyStateUnsent || request.readyState() == readyStateDone)
404
406
{
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");
408
423
}
409
424
}
410
425
@@ -587,6 +602,7 @@ IPAddress ip(192, 168, 2, 232);
587
602
588
603
```
589
604
Start AsyncHTTPRequest_STM32 on NUCLEO_F767ZI
605
+ AsyncHTTPRequest_Generic v1.1.1
590
606
AsyncHTTPRequest @ IP : 192.168.2.72
591
607
592
608
**************************************
@@ -631,6 +647,7 @@ week_number: 37
631
647
632
648
```
633
649
Starting AsyncHTTPRequest_ESP_WiFiManager using LittleFS on ESP8266_NODEMCU
650
+ AsyncHTTPRequest_Generic v1.1.1
634
651
Stored: SSID = HueNet1, Pass = 12345678
635
652
Got stored Credentials. Timeout 120s
636
653
ConnectMultiWiFi in setup
@@ -663,6 +680,7 @@ HHHHHH
663
680
664
681
```
665
682
Starting AsyncHTTPRequest_ESP_WiFiManager using SPIFFS on ESP32_DEV
683
+ AsyncHTTPRequest_Generic v1.1.1
666
684
Stored: SSID = HueNet1, Pass = 12345678
667
685
Got stored Credentials. Timeout 120s
668
686
ConnectMultiWiFi in setup
@@ -713,6 +731,7 @@ HHHHHHHHH HHHHHHHHHH HHHHHHHHHH
713
731
714
732
```
715
733
Starting AsyncHTTPRequest_ESP using ESP8266_NODEMCU
734
+ AsyncHTTPRequest_Generic v1.1.1
716
735
Connecting to WiFi SSID: HueNet1
717
736
...........
718
737
HTTP WebServer is @ IP : 192.168.2.81
@@ -744,6 +763,7 @@ HHHHHHHHH HHHHHHHHHH HHHHHHHHHH H
744
763
745
764
```
746
765
Start AsyncWebClientRepeating_STM32 on NUCLEO_F767ZI
766
+ AsyncHTTPRequest_Generic v1.1.1
747
767
AsyncHTTPRequest @ IP : 192.168.2.72
748
768
749
769
**************************************
0 commit comments