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

[core-rest-pipeline] support resettable stream request body #21013

Merged
merged 6 commits into from
Mar 24, 2022

Conversation

jeremymeng
Copy link
Member

add support of the following request body types

  • () => NodeJS.ReadableStream for NodeJS
  • () => ReadableStream<Uint8Array> for browser

Packages impacted by this PR

core-rest-pipeline

Issues associated with this PR

#20831

Describe the problem that is addressed by this PR

We support this in core-http but not in core-rest-pipeline.

add support of the following request body types

- `() => NodeJS.ReadableStream` for NodeJS
- `() => ReadableStream<Uint8Array> for browser
@ghost ghost added the Azure.Core label Mar 24, 2022
Copy link
Member

@deyaaeldeen deyaaeldeen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good

@azure-sdk
Copy link
Collaborator

API changes have been detected in @azure/core-rest-pipeline. You can review API changes here

API changes

- export declare type RequestBodyType = NodeJS.ReadableStream | ReadableStream<Uint8Array> | Blob | ArrayBuffer | ArrayBufferView | FormData | string | null;
+ export declare type RequestBodyType = NodeJS.ReadableStream | (() => NodeJS.ReadableStream) | ReadableStream<Uint8Array> | (() => ReadableStream<Uint8Array>) | Blob | ArrayBuffer | ArrayBufferView | FormData | string | null;

Copy link
Member

@xirzec xirzec left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome! Thanks for doing this. 👍

@jeremymeng jeremymeng enabled auto-merge (squash) March 24, 2022 22:47
@jeremymeng jeremymeng merged commit 1a24b18 into Azure:main Mar 24, 2022
@jeremymeng jeremymeng deleted the core/allow-stream-factory-method branch March 24, 2022 23:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants