JavaScriptのfetchでPOSTリクエストをする
const obj = {title: "This is fetch"}; const options ={ method: "POST", headers: { 'Accept': 'application/json', 'Content-Type': 'application/json' }, body: JSON.stringfy(obj) } fetch("https://example.com", options) .then((res)=> res.json()) .catch(console.error);
参考
https://developer.mozilla.org/ja/docs/Web/API/WindowOrWorkerGlobalScope/fetch