A POST request requires that the content-type be set in the request header in order for values to actually be seen as parameters by the request object in your servlet:
var ajax = new XMLHttpRequest(); //Send the proper header information along with the request ajax.setRequestHeader( "Content-type", "application/x-www-form-urlencoded"); ajax.setRequestHeader("Content-length", params.length); ajax.setRequestHeader("Connection", "close"); // Send data in 'params' as post data.
Thanks to: http://www.openjs.com/articles/ajax_xmlhttp_using_post.php
No comments:
Post a Comment