export async function main(url: string, body: object) {
let resp = await fetch(url, {
method: "POST",
headers: {
"Content-Type": "application/json",
"X-API-Key": "foobar",
},
body,
});
return { "response": await resp.text() }
}
Submitted by rossmccrann 899 days ago
export async function main(body: string) {
let resp = await fetch("https://example.com", {
method: "POST",
headers: {
"Content-Type": "application/json",
"X-API-Key": "foobar",
},
body,
});
return { "response": await resp.text() }
}
Submitted by rossmccrann 899 days ago
export async function main() {
const body = `{"name": "Deno"}`;
let resp = await fetch("https://example.com", {
method: "POST",
headers: {
"Content-Type": "application/json",
"X-API-Key": "foobar",
},
body,
});
return { "response": await resp.text() }
}
Submitted by rossmccrann 926 days ago