Skip to content

Commit

Permalink
- adds a content type parameter to set stream content
Browse files Browse the repository at this point in the history
Signed-off-by: Vincent Biret <vibiret@microsoft.com>
  • Loading branch information
baywet committed Oct 12, 2023
1 parent aba545b commit ae7dc31
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions packages/abstractions/src/requestInformation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -249,9 +249,19 @@ export class RequestInformation {
/**
* Sets the request body to be a binary stream.
* @param value the binary stream
* @param contentType the content type.
*/
public setStreamContent = (value: ArrayBuffer): void => {
this.tryAddRequestHeaders(RequestInformation.contentTypeHeader, RequestInformation.binaryContentType);
public setStreamContent = (
value: ArrayBuffer,
contentType?: string,
): void => {
if (!contentType) {
contentType = RequestInformation.binaryContentType;
}
this.tryAddRequestHeaders(
RequestInformation.contentTypeHeader,
contentType,
);
this.content = value;
};
/**
Expand Down

0 comments on commit ae7dc31

Please sign in to comment.