Problem
We have a firewall using nearly identical lines in HTTPPoster, where only the username and password is different. One of them refuses to login. The only difference is that the one that does not work has non-alphanumeric characters like ‘$’ in the password or username.
Solution
Encode such non-alphanumeric characters using URL encoding. This is done by replacing the character with a “%” symbol followed by its two-digit hexadecimal representation.
Example of some characters that need to be URL encoded
Character | What to write |
Space | %20 |
" (quote) | %22 |
# (pound/hash) | %23 |
$ (dollar) | %24 |
% (percent) | %25 |
& (ampersand) | %26 |
+ (plus) | %2B |
: (colon) | %3A |
@ ("at") | %40 |
Syntax example
Username alice, password very@secret%pw at host foo.com would become http://alice:very%40secret%25pw@foo.com/
Related articles
No related articles found.