Manually create a form to the URL and using the POST method and submit the form. Here is solution both in pure JavaScript and JQuery-
pure-JavaScript solution-
function post_redirect(URL, args){
var form_tag = document.createElement("form");
form_tag.setAttribute('method',"POST");
form_tag.setAttribute('action', URL);
for(key in args){
var input_tag = document.createElement("input");
input_tag.type = "text";
input_tag.name = key;
input_tag.value = args[key];
form_tag.appendChild(input_tag);
}
form_tag.submit();
}
Using JQuery -
function post_redirect(URL, args){
form_str = '<form method = "POST" action = ' + URL + '>';
for(key in args){
form_str += '<input type="text" name="'+ key +'" value = "'+ args[key] +'"/>';
}
$(form_str).submit();
}
How it works-
args = {
"name1" : "value1",
"name2" : "value2",
"name3" : "value3",
"name4" : "value4"
};
URL = "a.php";
post_redirect(URL, args);
//Re-directed to page pointed by URL