const Url='https://jsonplaceholder.typicode.com/posts'; const Data={ name:"Said", id:23 }; // optional parameters const othePram={ header:{ "content-type":"application/json; charset=UTF - 8" }, body:Data, method:"POST" }; fetch(Url,othePram) .then(data=>{return data.json()}) .then(res=>{console.log(res)}) .catch(error=>console.log(error))
Provides a JavaScript interface for accessing and manipulating parts of the HTTP pipeline.