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

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

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

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