0

Send any HTTP 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, request_type: string) {
4
  const req = new Request(url, {
5
    method: request_type,
6
  });
7
  let resp = await fetch(req);
8

9
  return { response: await resp.text() };
10
}
11

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