I am trying to make a GET request to my dreamfactory endpoint. But, I am getting the 401 code while doing so from my angular app. But the request was made successfully when I made it from Postman.
Here’s the snippet:
var header = {headers: {
"X-DreamFactory-Application-Name" : "myApp",
}};
$scope.doLogin = function (){
$scope.login = $stateParams.login;
$http.get('https://some-url.cloud.dreamfactory.com:443/rest/db/myapp', header).success(function ( response ) {
$scope.logins = response.record;
//console.log($scope.logins);
});
$scope.goHome = function () {
$state.go('app.home');
};
}
Where Am I going wrong?