Search... Ctrl + K

Send POST Request (http)
One script reply has been approved by the moderators Verified

Created by danielmurvi 178 days ago Used 169 times 1 Point

No comments yet

Points: 0
deno
One script reply has been approved by the moderators
Ap­pro­ved
export async function main(url: string, body: object = {}) {
    const resp = await fetch(url, {
        method: "POST",
        headers: {
            "Content-Type": "application/json",
        },
        body: JSON.stringify(body),
    });

    return {
        ok: resp.ok,
        status: resp.status,
        text: await resp.text(),
    };
}

Submitted by jaller94 113 days ago

Edited 113 days ago

No comments yet