typescript - angular2 $http post请求报400错误,但$.post发送请求正常
本文介绍了typescript - angular2 $http post请求报400错误,但$.post发送请求正常的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
问 题
参数与后台要求一致,也是post请求,服务端解决跨域问题用的cors。报400错误。如下
发送请求的代码在server.ts文件中,如下:
getMyGroups: function(userId: string, type: string) {
return $http({
method: "post",
url: serverBaseUrl + "/message/getGroup.do",
data:{
tsId: userId,
type: type
}
});
},
求大神指点
解决方案
http://victorblog.com/2012/12...
解决了,按照上面这篇文章。
这篇关于typescript - angular2 $http post请求报400错误,但$.post发送请求正常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文