mirror of
https://github.com/denoland/deno.git
synced 2025-09-26 12:19:12 +00:00
fetch support URL instance as input (#3496)
This commit is contained in:
parent
7e116dd70d
commit
83f95fb8df
3 changed files with 21 additions and 13 deletions
|
@ -42,6 +42,13 @@ testPerm({ net: true }, async function fetchUrl(): Promise<void> {
|
|||
assertEquals(response.url, "http://localhost:4545/cli/tests/fixture.json");
|
||||
});
|
||||
|
||||
testPerm({ net: true }, async function fetchURL(): Promise<void> {
|
||||
const response = await fetch(
|
||||
new URL("http://localhost:4545/cli/tests/fixture.json")
|
||||
);
|
||||
assertEquals(response.url, "http://localhost:4545/cli/tests/fixture.json");
|
||||
});
|
||||
|
||||
testPerm({ net: true }, async function fetchHeaders(): Promise<void> {
|
||||
const response = await fetch("http://localhost:4545/cli/tests/fixture.json");
|
||||
const headers = response.headers;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue