private static HttpResponseMessage GetResponse(HttpConfiguration configuration, HttpResponseMessage initialResponse)
 {
     configuration.AddFiveLevelsOfMediaType();
     var handler = new DummyMessageHandler() { Response = initialResponse };
     var httpServer = new HttpServer(configuration, handler);
     var invoker = new HttpMessageInvoker(httpServer);
     return invoker.SendAsync(new HttpRequestMessage(HttpMethod.Get, "http://localhost/api/ddd"),
                                    CancellationToken.None).Result;
 }
Example #2
0
        private static HttpResponseMessage GetResponse(HttpConfiguration configuration, HttpResponseMessage initialResponse)
        {
            configuration.AddFiveLevelsOfMediaType();
            var handler = new DummyMessageHandler()
            {
                Response = initialResponse
            };
            var httpServer = new HttpServer(configuration, handler);
            var invoker    = new HttpMessageInvoker(httpServer);

            return(invoker.SendAsync(new HttpRequestMessage(HttpMethod.Get, "http://localhost/api/ddd"),
                                     CancellationToken.None).Result);
        }