开发者

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

开发者 https://www.devze.com 2023-01-26 13:29 出处:网络
Should encodeURIComponent be 开发者_Python百科used to encode parameters of post ajax request? Thanks YosefAssuming your request is using the content type application/x-www-form-urlencoded, then yes,

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

精彩评论

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