I am trying to add some custom headers to an API request.
var headers = {
'ivClient': 'CUSC',
'ivDARoles': 'NEWC,CUSC,BEND',
'ivGroups': 'AccountView,AccountWrite',
'ivUser': 'Anwar'
}
And passing this headers
variable into the $http
service like this :
$http({url:url, method:method, headers:headers, params:params, data:data })
When i am trying to execute the same API request from the REST POSTMAN
, getting this in header
section of network
tab :
Here, key-value
pair is coming properly and also getting the correct response from the api.
But when executing the same API request from the code getting this in header section of network tab :
Here, all keys are comes under same header Access-control-Request-Headers
without any value and also getting "No 'Access-Control-Allow-Origin'"
error in console.