0

Send GET Request

by
Published Jun 6, 2022
Script http Verified

The script

Submitted by hugo989 Typescript (fetch-only)
Verified 14 days ago
1
//native
2

3
export async function main(url: string) {
4
  const resp = await fetch(url);
5

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

Other submissions
  • Submitted by rossmccrann Deno
    Created 1441 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
    }
  • Submitted by jaller94 Deno
    Created 406 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