This URL returns a valid HTTP 200 status code, headers including a 'Content-Length': '0' header, and no message-body.
This URL / code:
for _ in range(0, 5):
response = requests.get("https://httpbin.org/status/200")
print(response.status_code)
print(response.reason)
print(response.headers)
print(response.text)
returns right away (less than a second) consistently in a browser or in python 3 (macOS).
In CircuitPython, each iteration takes about a minute to return, and sometimes gets an exception (usually the exception can happen in a loop of a few iterations):
RuntimeError: Unable to read HTTP response.
Interestingly, a shorter requests timeout in CircuitPython: requests.get("https://httpbin.org/status/200", timeout=5), comes back in 5 seconds rather than a minute, and seems far less prone to the "Unable to read HTTP response" exception so far.
This URL returns a valid HTTP 200 status code, headers including a
'Content-Length': '0'header, and no message-body.This URL / code:
returns right away (less than a second) consistently in a browser or in python 3 (macOS).
In CircuitPython, each iteration takes about a minute to return, and sometimes gets an exception (usually the exception can happen in a loop of a few iterations):
Interestingly, a shorter requests timeout in CircuitPython:
requests.get("https://httpbin.org/status/200", timeout=5), comes back in 5 seconds rather than a minute, and seems far less prone to the "Unable to read HTTP response" exception so far.