adafruit / Adafruit_CircuitPython_Requests

Requests-like interface for web interfacing
MIT License
51 stars 36 forks source link

Don't trust send works. Do one recv before creating Response #54

Closed tannewt closed 3 years ago

tannewt commented 3 years ago

This allows us to retry with a new socket. This greatly reduces the likelihood of Unable to read HTTP response.

anecdata commented 3 years ago

Initial testing: seems to address the

  File "adafruit_requests.py", line 594, in get
  File "adafruit_requests.py", line 581, in request
  File "adafruit_requests.py", line 119, in __init__
RuntimeError: Unable to read HTTP response.

that has been occurring with every other GET on ESP32-S2 (with chunked responses in this case). I'll keep at it.