angular-base64 icon indicating copy to clipboard operation
angular-base64 copied to clipboard

Error while retrieve the data

Open BUHARIMOHAMEDISMAIL opened this issue 8 years ago • 0 comments

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.

BUHARIMOHAMEDISMAIL avatar Jun 27 '17 12:06 BUHARIMOHAMEDISMAIL