How do I convert an HttpRequest into an HttpRequestBase object?

后端 未结 4 1386
耶瑟儿~
耶瑟儿~ 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:26

    You'll want to wrap your HttpRequest in a HttpRequestWrapper:

    var wrapper = new HttpRequestWrapper(httpRequest);
    

    The HttpRequestWrapper inherits from HttpRequestBase.

提交回复
热议问题