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)``
我经常提醒自己,并不是所有的信息都需要重构。我目前参加了一个训练营,知道吸收大量信息是多么困难,也知道管理时间以防止不知所措是多么困难。我希望本指南可以帮助您更好地理解 post 请求,并且简单明了,感谢您的阅读!
以上就是了解 Javascript 中的 POST 请求的详细内容,更多请关注php中文网其它相关文章!
每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号