I'm currently developing a web based app and encountering a weird problem. When I'm opening new window using POST parameter, it returns 404 error. But when I remove the POST parameter, the page loads fine. The problem happens only when I run the app in production server while when in localhost the problem does not occurs.
Here is an example of the code using POST:
let mapForm = document.createElement("form");
mapForm.target = "Report";
mapForm.method = "POST";
mapForm.action = 'http://1.1.1.1/example.php?sid=123';
let mapInput1 = document.createElement("input");
mapInput1.type = "text";
mapInput1.name = "TES";
mapInput1.value = 'TES VALUE';
mapForm.appendChild(mapInput1);
document.body.appendChild(mapForm);
var newwindow = window.open('',"Report","");
if(newwindow){
mapForm.submit();
}
document.body.removeChild(mapForm);
The above code will result in 404 error in production. Is there something missing in the code that I need to add or maybe permission problem on the server?