开发者

Should encodeURIComponent be used to encode parameters of post ajax request?

Should encodeURIComponent be 开发者_Python百科used to encode parameters of post ajax request?

Thanks Yosef


Assuming your request is using the content type application/x-www-form-urlencoded, then yes, it should — POST fields are also in name value pairs, just like GET requests. Special characters like &, =, [, ], etc need to be encoded just the same.


Yes, you never know when an ampersand is plotting against you.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜