【发布时间】:2016-01-21 19:12:21
【问题描述】:
我正在从现有的 WebApi 2 项目迁移代码,我想知道如何在 ASP.NET 5 MVC 6 中执行与以下代码等效的操作。我没有看到任何接受处理程序选项的路由代码。
config.Routes.MapHttpRoute("SomeApiProxy", "api/someapi/{*path}",
handler: HttpClientFactory.CreatePipeline(new HttpClientHandler(), new DelegatingHandler[] {new ForwardingProxyHandler(new Uri("http://some-api.com/api/v2/"))}),
defaults: new {path = RouteParameter.Optional},
constraints: null
);
【问题讨论】:
-
只是获取请求还是任何请求?
标签: c# asp.net-web-api asp.net-core asp.net-core-mvc