I am trying to sending some special character in header from javascript using this code:
$scope.validatePass = function (pincode,userName) {
httpCallConfig.headers = angular.extend(httpCallConfig.headers || {}, {
"Re-Authenticate-Me": "Yes"
, "j_username": userName
, "j_password": pincode
});
$http(httpCallConfig).then(
function (resps) {
if (resps === false) {
return;
}
$modalInstance.close(resps);
}
, function (data) {
if (data.status == 401) {
$log.info("faile pincode");
} else {
$log.error(data);
$scope.error = "other error!";
}
}
);
};
but getting a problem if userName contains any special characters å,ø,æ
then server return 401 status. Can someone tell me how and which encoding should i need to use if i need to send special characters.