Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var app = angular.module('myApp', ['base64']);
- app.controller('customersCtrl', function($scope, $http) {
- var auth = $base64.encode("Username:Password");
- var headers = {"Authorization": "Basic " + auth};
- var url="<URL>";
- $http.get(url,{headers: headers}).then(function(response) {
- $scope.myData = resonpse.somthing;
- });
- });
- var app = angular.module('myApp', ['base64']);
- app.controller('customersCtrl', function($scope, $http) {
- $http({
- method : "GET",
- url : "<URL>"
- headers: {
- 'Authorization': 'Basic <encoded string>',
- 'Accept': 'application/json',
- }
- }).then(function mySuccess(response) {
- $scope.myData = response.something;
- });
- });
Add Comment
Please, Sign In to add comment