我试图通过XML HTTP请求将HTML字符串传递给服务器端我得到500(内部服务器错误)。它适用于普通字符串。
这是我的代码,
var http = new XMLHttpRequest();
var url = 'https://abcxyz.com/book.asmx/GetPDF';
var params = 'html='+escape('<html><head></head><body>Keerthi Kumar</body></html>')+'&fileName='+fileName+'&downloadedOn='+downloadedOn+'';
http.open('POST', url, true);
http.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
http.onreadystatechange = function()
{
if(http.readyState == 4 && http.status == 200)
{
var xmlDocument = $.parseXML(http.responseText);
}
}
http.send(params);
我在这里遗漏了什么吗?