http测试方法三
二、浏览器控制台直接测试http请求
$.ajax({
type:‘post’,
url:‘/api/test?’,
data:JSON.stringify({“id”:“123”,
“name”:“ttt”,
“age”: “18”,
“alarmId”:“aaa” }),
contentType:“application/json”,
success: res=>{
console.log(res)
},
error: e=>{
console.log(e)
}
})
$.ajax({
type:‘get’,
url:‘/api/testget’,
contentType:“application/json”,
success: res=>{
console.log(res)
},
error: e=>{
console.log(e)
}
})