[LayaAir3]后端用的是java,联调时候接不到数据
求各位大神帮助,真的非常感谢!
initHttpRequest(): void {
let maryParam1: MaryParam = {
id: parseInt(Laya.LocalStorage.getItem("userOrder")),
point: parseInt(this.addPoint.text)
};
let maryParam = JSON.stringify(maryParam1);
this.hr = new Laya.HttpRequest();
this.hr.send('http://localhost:8081/mary/change/one', { id: 28, point: 100 }, 'post', 'json', ["Content-Type", "application/json"])
}
后端报错信息如下:2024-06-24 14:19:01.369 ERROR 21416 --- [io-8081-exec-10] c.e.g.exception.GlobalExceptionHandler
: Throwable异常: Invalid mime type "application/json, application/json": Invalid token
character ',' in token "json, application/json"
initHttpRequest(): void {
let maryParam1: MaryParam = {
id: parseInt(Laya.LocalStorage.getItem("userOrder")),
point: parseInt(this.addPoint.text)
};
let maryParam = JSON.stringify(maryParam1);
this.hr = new Laya.HttpRequest();
this.hr.send('http://localhost:8081/mary/change/one', { id: 28, point: 100 }, 'post', 'json', ["Content-Type", "application/json"])
}
后端报错信息如下:2024-06-24 14:19:01.369 ERROR 21416 --- [io-8081-exec-10] c.e.g.exception.GlobalExceptionHandler
: Throwable异常: Invalid mime type "application/json, application/json": Invalid token
character ',' in token "json, application/json"
没有找到相关结果
已邀请:
要回复问题请先登录
1 个回复
正阳子
赞同来自: