form = document.createElement('form');
form.method = 'POST';
form.action = location.href.replace();
document.body.appendChild(form);
form.submit();