0

Why

Uri.IsWellFormedUriString("http://www.foo@foo.com", UriKind.Absolute);

return true ?!

Can we use @ in a website domain?!!!

  • 1
    See this question for details on which characters are allowed in a `url`: http://stackoverflow.com/questions/7109143/what-characters-are-valid-in-a-url – Bassie Sep 12 '16 at 12:51

3 Answers3

3

Yes it's optional and can be used for authentication more here enter image description here

BRAHIM Kamel
  • 13,492
  • 1
  • 36
  • 47
1

Yes you can. The part before the @ sign is the username.

nvoigt
  • 75,013
  • 26
  • 93
  • 142
1

Yes we can.

If you put this url in your browser, it will warn you (at least my firefox does so) that you are trying to authenticate with foo.com as user www%2Efoo.

The @ is used to separate user credentials from the address. This is rarely used with http, but more often with ftp: ftp://user:password@domain.com.

René Vogt
  • 43,056
  • 14
  • 77
  • 99