URL: Username with @

HttpUrlUrl Encoding

Http Problem Overview


To send username and password with a URL, we use this scheme:

http://username:[email protected]_site.com

But my username is [email protected].
The problem is the @.

How can I solve it?

Http Solutions


Solution 1 - Http

You need to URL encode the @ as %40.

Solution 2 - Http

Use %40 in your username instead of the @ symbol for the url encoding. It should pass it properly then.

Solution 3 - Http

Just do:

 http://my_email%40gmail.com:[email protected]_site.com

I am quite surprised that problem was with username @ and not the password -usually this is where I get reserved characters in url authority or path parts.

To solve general case of special characters: Just open chrome console with F12 then paste encodeURIComponent(str) where str is your password (or username) and then use the encoded result to form url with password.

Hope this saves you some time.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionRodrigoView Question on Stackoverflow
Solution 1 - HttpJoeView Answer on Stackoverflow
Solution 2 - HttpmatthewnreidView Answer on Stackoverflow
Solution 3 - HttpMatas VaitkeviciusView Answer on Stackoverflow