Skip to content
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

Accept AsyncIterator as an HTTP request body #221

Open
RikkiGibson opened this issue Sep 11, 2018 · 4 comments
Open

Accept AsyncIterator as an HTTP request body #221

RikkiGibson opened this issue Sep 11, 2018 · 4 comments

Comments

@RikkiGibson
Copy link
Member

See the article on async iterators: https://jakearchibald.com/2017/async-iterators-and-generators/

This is probably only for nodejs, at least to start with, because browsers don't support streaming request bodies (not even fetch at this point, even though it's in the spec). This is a more modern alternative to the nodejs stream interface.

@bterlson may wish to comment on this

@bterlson
Copy link
Member

bterlson commented Sep 11, 2018

I support this 100%!!

But why just uint8array? AsyncIterator<string> could be allowed as well?

@RikkiGibson
Copy link
Member Author

I think it could be AsyncIterator<string | ArrayBuffer | ArrayBufferView> without any ill effects.

See the current HttpRequestBody for reference:

export type HttpRequestBody = Blob | string | ArrayBuffer | ArrayBufferView | (() => NodeJS.ReadableStream);

@bterlson
Copy link
Member

Yes, sounds excellent.

@RikkiGibson RikkiGibson changed the title Accept AsyncIterator<Uint8Array> as an HTTP request body Accept AsyncIterator as an HTTP request body Sep 11, 2018
@ghost ghost added this to the Sprint-127 milestone Nov 5, 2018
@ghost ghost removed this from the Sprint-127 milestone Dec 4, 2018
@ramya-rao-a
Copy link
Contributor

@jeremymeng Is this applicable for the new Azure Core v2? If so, please create a new issue in the azure-sdk-for-js repo and close this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants