mirror of
https://github.com/denoland/deno.git
synced 2025-09-29 21:54:48 +00:00
fix: Allow ArrayBuffer as Fetch request body (#5831)
This commit is contained in:
parent
c9f0e34e29
commit
1c4a9665e2
2 changed files with 15 additions and 0 deletions
|
@ -505,6 +505,8 @@ export async function fetch(
|
|||
contentType = "text/plain;charset=UTF-8";
|
||||
} else if (isTypedArray(init.body)) {
|
||||
body = init.body;
|
||||
} else if (init.body instanceof ArrayBuffer) {
|
||||
body = new Uint8Array(init.body);
|
||||
} else if (init.body instanceof URLSearchParams) {
|
||||
body = new TextEncoder().encode(init.body.toString());
|
||||
contentType = "application/x-www-form-urlencoded;charset=UTF-8";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue