AngularJS getting request header of $http


#1

I want to get the $http cookie request header after a request but the $http only returns a response according to the AngularJS documentation. Here is the cookie I want to get:

I tried adding an interceptor but I couldn’t see the cookie. Here is the output from my interceptor:

My interceptor and some settings:

$provide.factory(‘myHttpInterceptor’, function() {
return {
// optional method
’request’: function(config) {
console.log(config);
return config;
}
};
});

$httpProvider.interceptors.push('myHttpInterceptor');
$httpProvider.defaults.useXDomain = true;
//Remove text on back button
$ionicConfigProvider.backButton.previousTitleText(false).text('  ');
$httpProvider.defaults.withCredentials = true;
//Setting angularjs' $http to behave as url encoded parameters and request instead of JSON
$httpProvider.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded;charset=utf-8';

#2

Did you find an answer for this ?