I'm converting ASP.NET web application to MVC Web Api project.
One of my methods expects HttpRequest
class. However, Web Api controller holds only HttpRequestMessage
(this.Request
) object.
Do you know how I can convert HttpRequestMessage
to HttpRequest
?
You probably don't need to convert from HttpRequestMessage. There is another way:
var context = new HttpContextWrapper(HttpContext.Current);
HttpRequestBase request = context.Request;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With