Edits history of script submission #94 for ' Send POST Request (http)'

  • deno
    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 1387 days ago