-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Refactor data stream uploading for client api #1172
Comments
Sounds good for me. |
I have no idea how this single interface should look like. |
I ran into something I don't understand on this topic, and posted on Stackoverflow. Is this related? http://stackoverflow.com/questions/40299114/with-aiohttp-post-how-do-i-pass-it-some-data-to-iterate |
I don't understand do you have problems with your example or not? Yes, coroutine support should be deprecated but it still exists and working. |
I am working on refactoring in |
merged |
Now
aiohttp.ClientSession.request(..., data=data)
supports too many available constructions:FormData
asyncio.StreamReader
aiohttp.StreamReader
io.IOBase
bytes
bytearray
streams.DataQueue
coroutine
withyields
insideI propose to drop (well, with deprecation period) two latest options but implement support for asynchronous iterators as data source.
Async generators is the most native way for upload BODY asynchronously IMHO.
Python 3.6 allows to write them with very elegant syntax (https://www.python.org/dev/peps/pep-0525/). As workaround for Python 3.5 user may use https://github.com/njsmith/async_generator
It should fix also long standing #183
The text was updated successfully, but these errors were encountered: