Skip to content

RequestContext Class ​

Definition ​

Encapsulates information about an HTTP Request

  • Namespace: JASE.Web
  • Assembly: JASE.Web.dll

Constructors ​

NameDescription
RequestContext(IHttpContextAccessor httpContextAccessor, string callingFile = null, string callingMethod = null, int callingLine = null)RequestContext constructor for dependency injection requesting IHttpContextAccessor

Properties ​

NameDescription
ActionCountCount of active Actions
HttpContextAccess to the current HttpContext
HttpMethodThe HTTP Verb
IsMockHttpContextTRUE if the HttpContext is mocked due to not being injected/provided
IsSystemReturns true if running in a System context
RequestHeadersReturns read only copy of the headers contained in the HTTP Request, header keys are case insensitive
RequestIPThe IP address of the HTTP Request
RequestUidUnique identifier of the RequestContect object
RouteInfoRoute Information detected from URL path request
UrlThe URL Requested by the HTTP Request

Methods ​

NameDescription
long ActionCountDecrement()Decrement the current MVC Action counter
long ActionCountIncrement()Increment the current MVC Action counter
string ReadRequestBody()Returns current Request body as a string