mirror of
https://github.com/denoland/deno.git
synced 2025-09-30 22:21:15 +00:00
Add Request global constructor (#2253)
This commit is contained in:
parent
1dd30f658f
commit
c05cbc8eac
12 changed files with 663 additions and 13 deletions
|
@ -99,6 +99,20 @@ testPerm({ net: true }, async function fetchInitStringBody(): Promise<void> {
|
|||
assert(response.headers.get("content-type").startsWith("text/plain"));
|
||||
});
|
||||
|
||||
testPerm({ net: true }, async function fetchRequestInitStringBody(): Promise<
|
||||
void
|
||||
> {
|
||||
const data = "Hello World";
|
||||
const req = new Request("http://localhost:4545/echo_server", {
|
||||
method: "POST",
|
||||
body: data
|
||||
});
|
||||
const response = await fetch(req);
|
||||
const text = await response.text();
|
||||
assertEquals(text, data);
|
||||
assert(response.headers.get("content-type").startsWith("text/plain"));
|
||||
});
|
||||
|
||||
testPerm({ net: true }, async function fetchInitTypedArrayBody(): Promise<
|
||||
void
|
||||
> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue