BloggingSystem.IntegrationTests.InMemoryHttpServer.Get C# (CSharp) Method

Get() public method

public Get ( string requestUrl, string>.IDictionary headers = null, string mediaType = "application/json" ) : HttpResponseMessage
requestUrl string
headers string>.IDictionary
mediaType string
return System.Net.Http.HttpResponseMessage
        public HttpResponseMessage Get(
            string requestUrl,
            IDictionary<string, string> headers = null,
            string mediaType = "application/json")
        {
            var url = requestUrl;
            var request = new HttpRequestMessage();
            request.RequestUri = new Uri(baseUrl + url);
            request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(mediaType));
            request.Method = HttpMethod.Get;

            if (headers != null)
            {
                foreach (var header in headers)
                {
                    request.Headers.Add(header.Key, header.Value);
                }
            }

            var response = this.client.SendAsync(request).Result;
            return response;
        }