You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to call requests.get(some_REST_API_call) on a Pico W (with v1.22.1) but this call blocks infinitely.
Using a timeout or non-blocking mode (timeout=0) doesn't help.
The call works with CPython and in Chrome and returns some small JSON.
When using self._cached = self.raw.recv(10000) instead of self._cached = self.raw.read()
in requests/__init__.py (line 20) the call works fine.
So shouldn't this read() be replaced with a loop which tries to recv(num_bytes)
until it read less than num_bytes and then stops?
Update: Tested this with a different kind of device (calling the ThingSpeak API with requests.post) and for that only read() works correctly. recv(num_bytes) yields no bytes.
The text was updated successfully, but these errors were encountered:
I am trying to call
requests.get(some_REST_API_call)
on a Pico W (with v1.22.1) but this call blocks infinitely.Using a timeout or non-blocking mode
(timeout=0)
doesn't help.The call works with CPython and in Chrome and returns some small JSON.
When using
self._cached = self.raw.recv(10000)
instead ofself._cached = self.raw.read()
in
requests/__init__.py (line 20)
the call works fine.So shouldn't this
read()
be replaced with a loop which tries torecv(num_bytes)
until it read less than
num_bytes
and then stops?Update: Tested this with a different kind of device (calling the ThingSpeak API with
requests.post
) and for that onlyread()
works correctly.recv(num_bytes)
yields no bytes.The text was updated successfully, but these errors were encountered: