狐表端开启8081端口服务,发现请求之后狐表端弹窗“未收到数据”,说明响应狐表端没有接受到参数,另外浏览器这边报错,没有返回成功数据,这个axios是不是写错了
HttpRequest中代码如下:
Select Case e.path
Case "test"
If e.Values.ContainsKey("firstName") Then
MessageBox.Show(e.Values("firstName").ToString)
Else
MessageBox.Show("未收到数据!")
End If
e.WriteString("True")
end select
Vue中用axios请求
function signin() {
axios({
method: "get",
url: "http://127.0.0.1:8081/test",
data: {
firstName: "Fred",
lastName: "Flintstone",
},
})
.then(function (response) {
console.log(response);
});
}
[此贴子已经被作者于2022/11/2 11:43:22编辑过]