2
我有我通過Ajax發送回服務器的一些冗長的JSON文本:在Ajax POST中,在發送之前是否需要urlencode參數?
http.open("POST", url, true);
http.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
http.setRequestHeader("Content-length", myVeryLongAJAXText.length);
http.setRequestHeader("Connection", "close");
http.onreadystatechange = function() {...}
http.send(myVeryLongAJAXText);
我是否需要更改最後一行:
http.send(encodeURI(myVeryLongAJAXText));
或不發送方法照顧那個?