一个例子jquery:
var settings = {
"url": "http://xxx/login",
"method": "POST",
"timeout": 0,
"headers": {
"User-Agent": "Apifox/1.0.0 (https://www.apifox.cn)",
"Content-Type": "application/json",
"Accept": "*/*",
"Host": "xxx",
"Connection": "keep-alive"
},
"data": JSON.stringify({
"username": "admin",
"password": "admin123"
}),
};
$.ajax(settings).done(function (response) {
console.log(response);
});