Add Request global constructor (#2253)

This commit is contained in:
Kurt Mackey 2019-05-01 22:56:42 -05:00 committed by Ryan Dahl
parent 1dd30f658f
commit c05cbc8eac
12 changed files with 663 additions and 13 deletions

View file

@ -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
> {