Edits history of script submission #22425 for ' Send PUT Request (http)'

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

    Submitted by hugo989 5 days ago