angular-base64
angular-base64 copied to clipboard
Error while retrieve the data
I'm using the below code to retrieve the data.I'm getting an 401 unauthorized error.
var url = 'https://xxx.yyy.zzz-gtgl.com/obdo/newsfeedinteg';
var auth = $base64.encode("newsfeed:newsfeed@123"),
headers = {"Authorization": "Basic " + auth};
$http.get(url, {headers: headers}).success(function (resp) {
console.log(resp);
}).error(function (err) {
console.log(err);
});
When i was checking in postman it's working fine and get the json response. In postman I'm enter the username and password in Basic Auth field which comes under Authorization and content-type as application/json finally send the POST request.
Please assist me.