• put 更改
• delete 删除
<script src="js/jquery-1.12.4.min.js"></script>
<script>
// put 请求,更改数据
// $.ajax({
// url: "http://localhost:3000/comments/4",
// type: "put",
// dataType: "json",
// data: {"content": "good", "postId": 2},
// success: function (data) {
// console.log(data)
// }
// })
// delete 请求,删除数据
$.ajax({
url: "http://localhost:3000/comments/5",
type: "delete",
success: function (data) {
console.log(data)
}
})
</script>