- 博客(1)
- 收藏
- 关注
原创 js 发送post json格式请求
var xhr = new XMLHttpRequest();xhr.open("POST", "/service/hello", true);xhr.setRequestHeader('content-type', 'application/json');var sendData = {name:“abc”};//将用户输入值序列化成字符串xhr.send(JSON.stringify(sendData));//回调xhr.onreadystatechange = function()
2021-03-13 17:16:25 10127 1
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人