Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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

Thanks Yosef

like image 467
Ben Avatar asked Nov 22 '10 13:11

Ben


1 Answers

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.

like image 95
Andy E Avatar answered Nov 06 '22 06:11

Andy E