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 882 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 882 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 910 days ago