0
我必須使用UTF-8發送此請求,但它不起作用。UTF-8錯誤的HTTP請求?
如何使用UTF-8格式發送此請求?
var request = new ActiveXObject("Microsoft.XMLHTTP");
request.onreadystatechange = function()
{
if (request.readyState == 4)
{
// ret
}
}
httpUrl="/ISV/AddCustomerWebSite/Default.aspx?";
httpUrl = httpUrl + "vendorID="+paramsList[0]+
"&title="+paramsList[1]+
"&planTypeID=" +paramsList[2];
request.open("GET", httpUrl);
request.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; Charset=utf-8");
request.send(null);
在將它們添加到URL之前,您需要使用encodeURIComponent()對您的參數值進行編碼。 – Pointy
_你有什麼錯誤?_ – SLaks
encodeURIComponent()保存我thx – Mennano