resp"/> resp">
Home >Web Front-end >JS Tutorial >Understanding POST requests in Javascript
function newPlayer(newForm) { fetch("http://localhost:3000/Players", { method: "POST", headers: { 'Content-Type': 'application/json' }, body:JSON.stringify(newForm) }) .then(resp => resp.json()) // .then(player => console.log(player)) .then(player => showPlayer(player)) } function showPlayer (player) { console.log(player)``
I often remind myself that not all information needs to be refactored. I currently attend a bootcamp and know how difficult it can be to take in loads of information, and the difficulty of time management to keep from getting overwhelmed. I hope this guide helps you to better understand POST requests and was simple and sweet and thanks for the read!
The above is the detailed content of Understanding POST requests in Javascript. For more information, please follow other related articles on the PHP Chinese website!