How to set HTTP header for $http.GET request in angularjs? The AngularJs code sample as given below //This is the global var baseURL = "http://localhost:8080/" ; var emailId = window.utility.user.EmailID var userID = window.utility.user.UserID; var userLocationID = window.utility.user.UserLocationID; var authInfo = { Authorization: 'Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==' , UserID: userID, UserLocationID: userLocationID }; //END var app = angular.module( 'authApp' , []); //This is the angular services app.service( "myAuthServices" , function ($http) { this .getUsers = function (url) { return $http({ method: 'GET' , url: baseURL + url, ...
Angular, React, JavaScript, Java, PHP, SQL, C#, Vue, NodeJs, TypeScript and Interview Questions Answers