Send any HTTP Request
One script reply has been approved by the moderators Verified
Created by fatontibeesou 1288 days ago Picked 25 times
Submitted by rossmccrann Deno
Verified 222 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