我正在通过将HttpServer
实例直接传递给HttpClient
. 我怎样才能连线HttpClientHandler
?
Establish ctx = () =>
{
var config = new HttpConfiguration();
config.Routes.MapHttpRoute(name: "Default", routeTemplate: "api/{controller}/{id}", defaults: new { controller = "values", id = RouteParameter.Optional });
config.MessageHandlers.Add(new CompressionHandler());
var server = new HttpServer(config)
{
InnerHandler = new DecompressionHandler()
};
client = new HttpClient(server);
};