Send GET Request

Script http Verified

by armancedinari ยท 6/6/2022

The script

Submitted by jaller94 Deno
Verified 386 days ago
1
export async function main(url: string) {
2
  const resp = await fetch(url);
3

4
  return {
5
    ok: resp.ok,
6
    status: resp.status,
7
    text: await resp.text(),
8
  };
9
}
10

Other submissions
  • Submitted by rossmccrann Deno
    Created 1421 days ago
    1
    export async function main(url: string) {
    2
      const req = new Request(url, {
    3
        method: "GET",
    4
      });
    5
      let resp = await fetch(req);
    6
    
    
    7
      return { response: await resp.text() };
    8
    }