0

Send GET Request

Published Jun 6, 2022
Script http
Other submissions
  • Submitted by rossmccrann Deno
    Created 1588 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 554 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
    
    
  • Submitted by hugo989 Typescript (fetch-only)
    Created 162 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