What is the difference between the HttpRequestContext and HttpRequest? And how to convert the HttpRequestContext to HttpRequest?

1

What is the difference between the HttpRequestContext and HttpRequest? And how to convert the HttpRequestContext to HttpRequest?

    
asked by anonymous 27.01.2017 / 15:30

1 answer

1

As far as I know, HttpRequestContext is an object that is "inside" of HttpRequest .

The HttpRequest ( System.Web.HttpRequest ) returns the current request, where we can read QueryString for example.

The HttpRequestContext ( System.Web.Routing.RequestContext ) is the request within the current route, a MVC route for example. So much so that if a request not made through a route, for a direct page for example, HttpRequestContext is empty.

Converting a HttpRequestContext should not be a problem since it is always a request, so HttpRequest must be filled with the request data. Note that HttpRequestContext inherits from RequestContextBase , which in turn inherits from RequestContext , this may help.

    
30.01.2017 / 16:15