我是刚接触过天使的。我用的是离子框架。我试图调用json web服务,但它总是返回404。
当我尝试浏览器时,它的工作非常好。
这是我的代码:
function FetchCtrl($scope, $http) {
$scope.fetch = function() {
$http({method: 'GET', url: 'http://example.com/anyservice'}).
success(function(data, status, headers, config) {
alert("data "+data);
}).
error(function(data, status, headers, config) {
alert("error "+status);
});
};
}发布于 2014-06-24 07:54:36
使用Chrome或FireFox开发工具并打开“网络”选项卡,然后试一试,看看实际的请求是什么,这将帮助您发现问题。
https://stackoverflow.com/questions/24381019
复制相似问题