I found a blog post that shows how to \"shim\" familiar things like HttpResponseMessage back into ASP.NET Core MVC, but I want to know what\'s the new native way to do the s
A cleaner way would be to use a UriBuilder
:
private static Uri GetUri(HttpRequest request)
{
var builder = new UriBuilder();
builder.Scheme = request.Scheme;
builder.Host = request.Host.Value;
builder.Path = request.Path;
builder.Query = request.QueryString.ToUriComponent();
return builder.Uri;
}
(not tested, the code might require a few adjustments)