Skip to content

Commit

Permalink
Allow file posting in SendAsync as well
Browse files Browse the repository at this point in the history
  • Loading branch information
DigitalFlow authored May 3, 2023
1 parent 4284e3b commit 04a8e0a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/js/WebApiClient.Core.js
Original file line number Diff line number Diff line change
Expand Up @@ -480,8 +480,8 @@

// Bugfix for IE. If payload is undefined, IE would send "undefined" as request body
if (payload) {
// For batch requests, we just want to send a string body
if (typeof(payload) === "string") {
// For batch requests, we just want to send a string body, files can also be sent as they are
if (typeof(payload) === "string" || ('File' in window && payload instanceof File)) {
xhr.send(payload);
}
else {
Expand Down Expand Up @@ -522,7 +522,7 @@

// Bugfix for IE. If payload is undefined, IE would send "undefined" as request body
if (payload) {
// For batch requests, we just want to send a string body
// For batch requests, we just want to send a string body, files can also be sent as they are
if (typeof(payload) === "string" || ('File' in window && payload instanceof File)) {
xhr.send(payload);
}
Expand Down

0 comments on commit 04a8e0a

Please sign in to comment.