Created
January 13, 2021 20:01
-
-
Save braden-w/0f816cd462339469ef9a06b634d5580c to your computer and use it in GitHub Desktop.
Implement fetch() in Deno. Taken from Deno Docs, Getting Started.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Run the following in command line: | |
deno run --allow-net testDeno.ts https://www.wikipedia.org/ | |
From: https://deno.land/[email protected]/getting_started/first_steps | |
*/ | |
const url = Deno.args[0] | |
const res = await fetch(url) | |
const body = new Uint8Array(await res.arrayBuffer()) | |
await Deno.stdout.write(body) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment