HttpClient less reliable than flashing

Long story short: HttpClient appears unreliable when wifi signal is weaker, but flashing the firmware works just fine, and my computer on the same network works just fine. Anything I should do to narrow down the problem or improve it?

More details:
Downstairs closer to my router, WiFi.RSSI() is around 50, and POST calls via HttpClient are reliable 100% of the time.

Upstairs where wifi is weaker, e.g. WiFi.RSS() is around 75, requests made with HttpClient seem to work about 25% of the time, and most often result in a response code of -1. Logs indicate it connected, but then no response is received. The same thing happens with multiple remote servers, so it’s definitely a client side problem. What’s really strange about this, though, is that I never have problems flashing the firmware in this room, and my laptop wifi works just fine.

I haven’t yet tried it extensively, but anecdotally Spark.publish() always works just fine.

I’m worried there may be a fundamental difference between the underlying network libraries, where HttpClient is inherently less resilient and fails to do some additional checks.

Any ideas what might be going on?

HttpClient is a contributed library, so you’d best ping the contributor and/or open an issue on the GitHub repo.

@mstrat that is a very interesting finding. Suggest you build a minimal test program and publish it so that others may test. Whilst you are at it, how about you “play off” TcpClient in the same test code to see if it has similar issues to HttpClient? The results of this will point the finger at the HttpClient lib or (assume) the underlying TcpClient.