function post_request(url, param){
console.log("执行post请求" + url)
const Http = new XMLHttpRequest()
Http.open("POST", url)
Http.setRequestHeader("Content-type","application/json")
var info = param
Http.send(info)
Http.onreadystatechange = function(){
if(Http.readyState == 4 && Http.status == 200){
var json = Http.responseText
console.log(json)
}
}
}
js发送http请求
最新推荐文章于 2024-08-28 18:38:57 发布