No1Lives4Ever
No1Lives4Ever

Reputation: 6883

Uri is accepting domain without root?

I trying to understand why Uri object is accepting this URL:

http://test/dir/page?id=1

I'm loading this URL with this code:

    string u = "http://test/dir/page?id=1";
    Uri url;
    if (!Uri.TryCreate(u, UriKind.Absolute, out url))
        throw new InvalidUrlException(u);

For me, this URL is seems missing.

What do you think?

Upvotes: 1

Views: 51

Answers (1)

Peter Gluck
Peter Gluck

Reputation: 8236

It is a valid URL when your local server name is test.

Upvotes: 2

Related Questions