Skip to content
This repository was archived by the owner on Feb 4, 2023. It is now read-only.

Commit 5a5350b

Browse files
authored
v1.1.1
### Releases v1.1.1 1. Prevent crash if request and/or method not correct.
1 parent 16d2425 commit 5a5350b

File tree

1 file changed

+23
-3
lines changed

1 file changed

+23
-3
lines changed

README.md

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -400,11 +400,26 @@ Ticker sendHTTPRequest(sendRequest, HTTP_REQUEST_INTERVAL_MS, 0, MILLIS);
400400

401401
void 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
```
589604
Start AsyncHTTPRequest_STM32 on NUCLEO_F767ZI
605+
AsyncHTTPRequest_Generic v1.1.1
590606
AsyncHTTPRequest @ IP : 192.168.2.72
591607
592608
**************************************
@@ -631,6 +647,7 @@ week_number: 37
631647

632648
```
633649
Starting AsyncHTTPRequest_ESP_WiFiManager using LittleFS on ESP8266_NODEMCU
650+
AsyncHTTPRequest_Generic v1.1.1
634651
Stored: SSID = HueNet1, Pass = 12345678
635652
Got stored Credentials. Timeout 120s
636653
ConnectMultiWiFi in setup
@@ -663,6 +680,7 @@ HHHHHH
663680

664681
```
665682
Starting AsyncHTTPRequest_ESP_WiFiManager using SPIFFS on ESP32_DEV
683+
AsyncHTTPRequest_Generic v1.1.1
666684
Stored: SSID = HueNet1, Pass = 12345678
667685
Got stored Credentials. Timeout 120s
668686
ConnectMultiWiFi in setup
@@ -713,6 +731,7 @@ HHHHHHHHH HHHHHHHHHH HHHHHHHHHH
713731

714732
```
715733
Starting AsyncHTTPRequest_ESP using ESP8266_NODEMCU
734+
AsyncHTTPRequest_Generic v1.1.1
716735
Connecting to WiFi SSID: HueNet1
717736
...........
718737
HTTP WebServer is @ IP : 192.168.2.81
@@ -744,6 +763,7 @@ HHHHHHHHH HHHHHHHHHH HHHHHHHHHH H
744763

745764
```
746765
Start AsyncWebClientRepeating_STM32 on NUCLEO_F767ZI
766+
AsyncHTTPRequest_Generic v1.1.1
747767
AsyncHTTPRequest @ IP : 192.168.2.72
748768
749769
**************************************

0 commit comments

Comments
 (0)