Class RestHttpHandler

A http handler that implements Rest Controllers

Inheritance
System.Object
RestHttpHandler
Implements
System.Web.IHttpAsyncHandler
System.Web.IHttpHandler
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: EPiServer.Shell.Services.Rest
Assembly: EPiServer.Shell.dll
Version: 8.11.0
Syntax
public class RestHttpHandler : IHttpAsyncHandler, IHttpHandler

Constructors

RestHttpHandler(RequestContext)

Initializes a new instance of the RestHttpHandler class.

Declaration
public RestHttpHandler(RequestContext requestContext)
Parameters
Type Name Description
System.Web.Routing.RequestContext requestContext

The request context in which the request is processed.

Properties

Controller

The controller in which the request is executed.

Declaration
public IController Controller { get; }
Property Value
Type Description
System.Web.Mvc.IController

IsReusable

Gets a value indicating whether another request can use the System.Web.IHttpHandler instance.

Declaration
public bool IsReusable { get; }
Property Value
Type Description
System.Boolean

RequestContext

The context in which the request is executed.

Declaration
public RequestContext RequestContext { get; }
Property Value
Type Description
System.Web.Routing.RequestContext

Methods

BeginProcessRequest(HttpContext, AsyncCallback, Object)

Registers handler for async notification

Declaration
public IAsyncResult BeginProcessRequest(HttpContext context, AsyncCallback cb, object extraData)
Parameters
Type Name Description
System.Web.HttpContext context

The context

System.AsyncCallback cb

The callback

System.Object extraData

The extra data

Returns
Type Description
System.IAsyncResult

BeginProcessRequest(HttpContextBase, AsyncCallback, Object)

Registers handler for async notification

Declaration
public IAsyncResult BeginProcessRequest(HttpContextBase context, AsyncCallback callback, object extraData)
Parameters
Type Name Description
System.Web.HttpContextBase context

The context

System.AsyncCallback callback

The callback

System.Object extraData

The extra data

Returns
Type Description
System.IAsyncResult

EndProcessRequest(IAsyncResult)

Ends the request

Declaration
public void EndProcessRequest(IAsyncResult result)
Parameters
Type Name Description
System.IAsyncResult result

ParseRequestUrl(String, out String, out String)

Parses the app relative request URL to find store name and an optional id parameter.

Declaration
protected virtual bool ParseRequestUrl(string url, out string storeName, out string id)
Parameters
Type Name Description
System.String url

The incoming application relative URL.

System.String storeName

Name of the store.

System.String id

An optional id parameter.

Returns
Type Description
System.Boolean

true if parsing succeeds; otherwise false

ProcessRequest(HttpContext)

Processes the request by calling into the unit testable overload.

Declaration
public void ProcessRequest(HttpContext context)
Parameters
Type Name Description
System.Web.HttpContext context

The HTTP context.

ProcessRequest(HttpContextBase)

Performs the actual request processing.

Declaration
public virtual void ProcessRequest(HttpContextBase httpContext)
Parameters
Type Name Description
System.Web.HttpContextBase httpContext

The HTTP context.

ValidateAntiForgeryToken(HttpContextBase)

Validates the Cross site request anti forgery token sent in the header with the token stored in a cookie.

Declaration
protected virtual void ValidateAntiForgeryToken(HttpContextBase httpContext)
Parameters
Type Name Description
System.Web.HttpContextBase httpContext

The HTTP context.

Remarks

Throws an System.Exception if validation fails.

Implements

System.Web.IHttpAsyncHandler
System.Web.IHttpHandler