项目描述
上传时间
浏览人数
举个栗子:
get类型:
<script> let url = "http://106.14.192.118/query_by_page"; let xmlHttp = new XMLHttpRequest(); xmlHttp.open("GET", url, false); xmlHttp.send(); let resp = xmlHttp.responseText; let jsonResp = JSON.parse(resp); console.log(jsonResp); </script>
post类型:
<script> let un = "乌龙奶茶"; let pw = "wulongnaicha"; let fm = new FormData(); fm.append("username", un); fm.append("password", pw); let url = "http://106.14.192.118/admin_log"; let xmlHttp = new XMLHttpRequest(); xmlHttp.open("POST", url, false); xmlHttp.send(fm); let resp = xmlHttp.responseText; let jsonResp = JSON.parse(resp); console.log(jsonResp); </script>