Skip to content

Commit

Permalink
consume the IO Stream directly instead of considering as byte[]
Browse files Browse the repository at this point in the history
  • Loading branch information
vigneshk-tw committed Oct 25, 2024
1 parent 686c605 commit 2ac841b
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions Xero.NetStandard.OAuth2/Client/ApiClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -401,8 +401,7 @@ private HttpRequestMessage NewRequest(
if (options.PathParameters.ContainsKey("FileName"))
{
contentType = contentType ?? "application/octet-stream";
var stream = new MemoryStream(options.Data as byte[]);
var streamContent = new StreamContent(stream);
var streamContent = new StreamContent(options.Data as Stream);
streamContent.Headers.ContentType = new MediaTypeHeaderValue(contentType);
request.Content = streamContent;
}
Expand Down

0 comments on commit 2ac841b

Please sign in to comment.