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

  • nativets
    One script reply has been approved by the moderators
    Ap­pro­ved
    export async function main(url: string, body: object = {}, headers: Record<string, string> = {}) {
      const resp = await fetch(url, {
        method: "POST",
        headers: {
          "Content-Type": "application/json",
          ...headers, 
        },
        body: JSON.stringify(body),
      });
    
      return {
        ok: resp.ok,
        status: resp.status,
        text: await resp.text(),
      };
    }
    

    Submitted by hugo697 442 days ago

  • nativets
    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 admin 1018 days ago

  • nativets
    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 rubenfiszel 1030 days ago