khoih-prog / AsyncHTTPRequest_Generic

Simple Async HTTP Request library, supporting GET, POST, PUT, PATCH, DELETE and HEAD, on top of AsyncTCP libraries, such as AsyncTCP, ESPAsyncTCP, AsyncTCP_STM32, etc.. for ESP32 (including ESP32_S2, ESP32_S3 and ESP32_C3), WT32_ETH01 (ESP32 + LAN8720), ESP8266 (WiFi or W5x00) and currently STM32 with built-in LAN8742A Ethernet.
GNU General Public License v3.0
95 stars 29 forks source link

Getting no response when making requests to an invalid-endpoint #37

Closed miwied closed 2 years ago

miwied commented 2 years ago

Here is my test code: https://gist.github.com/miwied/98c64c6a1f60ab90b46d12e555d8e813

When I am manually making http get requests to an invalid endpoint I get no error response. The "requestOpenResult" boolean is true all the time, no matter if the endpoint is reachable or not.

miwied commented 2 years ago

Sorry I forgot to put the Serial.println(request->responseHTTPcode()); in my code.

Now if I am making a request to a valid-endpoint I am getting response code, but weird ones. For example -13 or -55, what does this mean?

Here is my new test code: https://gist.github.com/miwied/d5592fad97739aab9b83f853c661a663

khoih-prog commented 2 years ago

https://github.com/khoih-prog/AsyncHTTPRequest_Generic/blob/2b193f78d3f67784977fba81e302d947d70ec056/src/AsyncHTTPRequest_Generic.hpp#L211-L221

To get more debugging codes, use

// Level from 0-4
#define ASYNC_HTTP_DEBUG_PORT     Serial
#define _ASYNC_HTTP_LOGLEVEL_     4 

Sorry I don't have time to help with these mundane issues, you're on your own to do more research before doing something hastily.

I'm closing the issue now as it's not a bug of the library.