コード例 #1
0
        public void Ctor_RelativeUriString()
        {
            var client = HttpClientTestHelpers.CreateHttpClient();

            client.BaseAddress = new Uri("http://en.wikipedia.org/wiki/");
            var req = new HttpRequestMessage(HttpMethod.Get, "Computer");

            // HttpRequestMessage does not rewrite it here.
            Assert.IsFalse(req.RequestUri.IsAbsoluteUri);
        }
コード例 #2
0
        public void Ctor_RelativeUri()
        {
            var client = HttpClientTestHelpers.CreateHttpClient();

            client.BaseAddress = new Uri("http://en.wikipedia.org/wiki/");
            var uri = new Uri("Computer", UriKind.Relative);
            var req = new HttpRequestMessage(HttpMethod.Get, uri);

            // HttpRequestMessage does not rewrite it here.
            Assert.AreEqual(req.RequestUri, uri);
        }