I need to convert Microsoft.AspNetCore.Http.HttpRequest from an AspNetCore context to an HttpRequestMessage to pass to an HttpClient. Is there
Both IHttpRequestMessageFeature and Microsoft.AspNetCore.Proxy are discontinued. IHttpRequestMessageFeature has been removed since ASP.NET Core 3.0.
Microsoft now has a new reverse proxy nuget package Microsoft.ReverseProxy based on ASP.NET Core infrastructure. As per their docs, IHttpProxy for direct proxying scenario can:
serve as the core proxy adapter between incoming AspNetCore and outgoing System.Net.Http requests. It handles the mechanics of creating a
HttpRequestMessagefrom aHttpContext, sending it, and relaying the response.
Here is an example.