Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- this.callAPI = function () {
- var dataObj="grant_type=client_credentials";
- console.log("dataObj in pricingservice =" + angular.toJson(dataObj));
- var secret=clientKey+":"+clientPass;
- var base64Encoded= btoa(secret);
- var authorizationVal="Basic "+base64Encoded;
- console.log("authorizationVal in pricingservice = "+authorizationVal);
- return $http({
- url: tokenAPI,
- method: 'POST',
- data: dataObj,
- withCredentials:true,
- headers: { "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8" ,"Authorization":authorizationVal}
- })
- // ONCE THE RESPONSE IS RECEIVED FROM ABOVE HTTP CALL , I WANT TO initiate NEXT HTTP CALL
- $http({
- url: anotherUrl,
- method: 'GET',
- withCredentials:true,
- headers: { "Content-Type": "application/json;charset=utf-8" ,"Authorization":authorizationVal }
- })
- };
Add Comment
Please, Sign In to add comment