Is there a better/more accurate/stricter method/way to find out if a URL is properly formatted?
Using:
bool IsGoodUrl = Uri.IsWellForm
Technically, htttp://www.google.com
is a properly formatted URL, according the URL specification. The NotSupportedException
was thrown because htttp
isn't a registered scheme. If it was a poorly-formatted URL, you would have gotten a UriFormatException
. If you just care about HTTP(S) URLs, then just check the scheme as well.