Reputation: 31
I am passing certain parameters in query string in a GET request let's say HOST?email=john**+[email protected]. When I try to access these in node express server through req.query.email, I get the value 'john [email protected]'. Express is converting '+**' character into space character. Is there a way that I can stop this encoding?
Upvotes: 2
Views: 820
Reputation: 30685
If you want to use the literal + sign, you need to URL encode it to %2b, e.g.
HOST?email=john**%[email protected].
That will decoded correctly by express, e.g.
req.query.email: john**[email protected].
Upvotes: 1