我是angularjs和离子开发的新手。在我的应用程序中,我在控制器中使用$ http发送GET消息。但现在我需要将GET请求发送到https URL,它总是给我错误代码 403 。
$scope.caption1 = "Empty";
$scope.method = 'GET';
$scope.url = 'index.html';
$http({method: $scope.method, url: $scope.url}).
then(function(response) {
console.log('Request successful');
if (response.data.reported.status === 'Vacant') {
$scope.caption1 = "Empty";
}else{
$scope.caption1 = "Filled";
}
$scope.data = response.data;
}, function(response) {
console.log('Request failed');
$scope.caption1 = "Error in connection";
});
};
我的https网址是AWS http api,需要附加证书