How do I convert an HttpRequest into an HttpRequestBase object?

后端 未结 4 1384
耶瑟儿~
耶瑟儿~ 2021-02-01 12:09

My problem is the opposite of this: How do I convert an HttpRequestBase into an HttpRequest object?

In my ASP.NET MVC application I have a method used by many controlle

4条回答
  •  再見小時候
    2021-02-01 12:28

    This is an another solution which does not require to create a new instance:

    var httpRequestBase = myHttpRequest.RequestContext.HttpContext.Request;
    

提交回复
热议问题