-
Notifications
You must be signed in to change notification settings - Fork 1k
micropython/aiohttp: Add aiohttp package. #778
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This is a really great contribution, thank you! A few top-level comments/questions:
|
4999119
to
2f8238f
Compare
Thanks for the feedback!
The original idea was to add this to
I would say so, e.g. all examples run as expected in MicroPython and CPython. The TLDR of the things that are implemented is: I think the main difference is that MicroPython implementation is missing some keyword arguments in Also if you see anything that can be improved let me know or feel free to add any changes and I can review them later (whatever is faster 👍🏼 ) |
) | ||
|
||
def get(self, url, ssl=None, params=None, headers={}): | ||
return _RequestContextManager( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To simplify and reduce code, all these convenience functions could be written like this:
def get(self, url, **kwargs):
return self.request("GET", url, **kwargs)
Even if that's slightly different in terms of allowed args (eg get
now allows the data
argument) I think it's worth doing because it greatly simplifies these functions.
Great, thanks for those details. That all looks fine, the code is all MIT.
That's really good, getting the quick-start code mostly working is great.
That's fine. These things can be added in the future if needed. |
2f8238f
to
de4391c
Compare
Implement `aiohttp` with `ClientSession`, websockets and `SSLContext` support. Only client is implemented and API is mostly compatible with CPython `aiohttp`. Signed-off-by: Carlos Gil <carlosgilglez@gmail.com>
de4391c
to
7cdf708
Compare
Thanks for updating. Now merged. |
Implement an updated version of
uaiohttpclient
(renamedaiohttp
) withClientSession
,WebSocketClient
andSSLContext
support, which is mostly compatible with CPython aiohttp-v3.9.1. client i.e. https://docs.aiohttp.org/en/stable/client_quickstart.htmlThis replaces #752 and #724 and requires: