I have the following code to call WebApi from localhost, which working great.
var app = angular.module('myApp', []);
app.controller('employeesController', function ($scope, $http) {
$http({
Method: 'GET',
url: 'http://localhost:50515/api/employees'
}).then(function (result) {
$scope.Getemployees = result.data;
});
});
i also setup WebApi service which working great tested using postman. But i would like to include WebApi Header information: ApiKey name and apikey value. how can i modify the above script?
url: https://example.api.services/api/XX/v2/employees/all //url from postman
Key: api-key
value: ba741c13417b7775524dbf0f417cefc4