urequest and timeout / iteration over results #16556
Unanswered
pn2new
asked this question in
Libraries & Drivers
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am trying to interface to ntfy.sh. Posting messages works, but I struggle polling/receiving messages from the server.
One way to achieve this would be, following examples:
However, micropython's built-in urequest seems not to allow to iterate over the lines received.
When I access the server from the command line using curl, like this
the messages are indeed shown, but the request does not "end". This seems to be by design, so that one keeps the connection open and receives the messages as they arrive.
What would be the best way to implement this in micropython? Is there a way to do this using the internal urequest, or do I need to used another library / other code?
Beta Was this translation helpful? Give feedback.
All reactions