【发布时间】:2015-08-10 18:35:43
【问题描述】:
在 angularjs 中没有收到简单的 http 响应,但在 curl 请求中成功返回。我启用了 CORS,并且在服务器中收到了 post 参数,但返回的响应始终为空白。
这是我的请求部分:
$http({
method: 'POST',
url: 'http://localhost:9000/adminAuth',
data: $.param({email:username,password:password})
}).then(function(response,status){
auth.user=response.data;
$cookieStore.put('user',auth.user);
return auth.user;
}, function(error) {
console.log(error);
});
控制台中打印的错误为:
【问题讨论】:
-
你会尝试添加这行数据吗:{ contentType: "application/json;charset=utf-8", email:username,password:password },
-
@Sunny_Sid 我得到了同样的空白回复。
-
请看我下面的帖子。可能对你有帮助。
标签: angularjs playframework playframework-2.0 angularjs-service angularjs-routing