Should encodeURIComponent be 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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With