来自 cordova 应用程序的现有 url 调用的 404 错误
404 error for an existing url calling from cordova app
这是我的 angular cordova 应用程序控制器
angular.module('mobApp.controllers', ['ionic'])
.controller('SignupController', function($scope, $http, $location) {
$scope.submitCommonSignUpForm = function(isValid, formData) {
if (isValid) {
var d = formData;
$http.post('http://X.X.X.X/api/v1.0/basicSignup',formData).
then(function(d){
}).
then(function(e){
});
}
};
});
我得到 404
http://X.X.X.X/api/v1.0/basicSignup
但事实是它存在。知道为什么吗?
在我的应用里面 platform > android > res > config.xml
我有set <access origin="*" />
您需要安装whitelist plugin from Cordova。
看我的previous answer regarding this:
You need to install the whitelist plugin to allow XHR support in your Cordova app. You can't make external requests without it.
Run: cordova plugin add https://github.com/apache/cordova-plugin-whitelist.git
这是我的 angular cordova 应用程序控制器
angular.module('mobApp.controllers', ['ionic'])
.controller('SignupController', function($scope, $http, $location) {
$scope.submitCommonSignUpForm = function(isValid, formData) {
if (isValid) {
var d = formData;
$http.post('http://X.X.X.X/api/v1.0/basicSignup',formData).
then(function(d){
}).
then(function(e){
});
}
};
});
我得到 404
http://X.X.X.X/api/v1.0/basicSignup
但事实是它存在。知道为什么吗?
在我的应用里面 platform > android > res > config.xml
我有set <access origin="*" />
您需要安装whitelist plugin from Cordova。
看我的previous answer regarding this:
You need to install the whitelist plugin to allow XHR support in your Cordova app. You can't make external requests without it.
Run:
cordova plugin add https://github.com/apache/cordova-plugin-whitelist.git