AngularJS: Response header returns empty object -


i using angularjs $http post methods response header manipulate location parameter. when inspect browser; shows response header containing location parameter value when comes angularjs response header object dosent containing @ empty object.

$http.post(mns_domain + server.message_proxy, json.stringify(payload))                 .success(function(data, status, headers, config) {             $scope.messagelocation = headers();              $scope.success = sucess_data_sent;             clearformdata();         })                 .error(function(errorcallback) {             $scope.error = errorcallback;             console.log("error " + errorcallback);         })                 . finally(function() {             console.log("rest call send message");         });          console.log($scope.error);     }; 

i have done using headers – {function([headername])} – header getter function.

you can this:

var headerobject = data.headers();  , access properties headerobject["propertyname"] value. 

$http


Comments

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -