使用 Ajax 和 GET 方法,我试图发送一个带括号的 url,但我没有得到正确的编码:
Request URL:http://myurl/search.html?_dc=1382510050331&search%5Bpostcode%5D=96231
代替:
Request URL:http://myurl/search.html?_dc=1382510050331&search[postcode]=96231
错误:
Status Code:502 Host not found
这是我的代码片段:
Ext.Ajax.request({
url: 'http://myulr.lan/fpsearchjson.html',
method: 'GET',
params: {
"geosearch[postcode]":91111
},
success: function(response){
console.log("success");
},
failure: function(response){
console.log("failure");
}
});
任何帮助将不胜感激!