Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
发布数组时,例如:
data: {id:[1,2,3]}
jQuery 将数据形成为(取自 firebug):
id%5B%5D=1&id%5B%5D=2&id%5B%5D=3
但是服务器端的解析器无法处理此类数据。
另一方面,如果我发布:
data:'id[]=1&id[]=2&id[]=3'
firebug 中的源代码如下所示:
id[]=1&id[]=2&id[]=3
并且解析器正确地形成数组。
有没有办法在 POST 请求中禁用括号编码?
我假设您正在使用 PHP。
服务器端,在解析数据之前使用urldecode