1
2
3
4
5
6
7
8
9
10
11
12
import { fetch } from "https://esm.town/v/std/fetch";
export let curl = async (url: string, options?: RequestInit) => {
const response = await fetch(url, options);
const headers = Object.fromEntries(response.headers.entries());
const body = await response.text();
return {
status: response.status,
headers: headers,
body: body,
};
};