StevenRuest / async_urequests

asynchronous / synchronous urequests for micropython.
MIT License
12 stars 4 forks source link

can you provide an example? #1

Closed varna9000 closed 3 years ago

varna9000 commented 3 years ago

How do you implement the response in other async code?

when I do: res=requests.get("http://xxx.xxx.xxx.xxx") print(res.content) I get AttributeError: 'generator' object has no attribute 'content'

Should I yeild the result somehow?

StevenRuest commented 3 years ago

you need to use "await", so: res = await requests.get("http://xxx.xxx.xxx.xxx")