Skip to content

Instantly share code, notes, and snippets.

@marr
Last active February 10, 2023 02:59
Show Gist options
  • Save marr/4243d2bd64f9c0abe8b1f135ae7c7eb6 to your computer and use it in GitHub Desktop.
Save marr/4243d2bd64f9c0abe8b1f135ae7c7eb6 to your computer and use it in GitHub Desktop.
import { ofetch } from "../dist/node.mjs";
let body;
body = { x: 1 }; // request body is "[object Object]"
// body = JSON.stringify(body); // request body is correctly received
const url ='https://d0348819-d0b4-4913-b739-360dfe6e0eef.mock.pstmn.io/debug';
const response = await ofetch(url, { body, method: "PATCH" });
console.log(response);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment