Class HttpRedirectException
When thrown, breaks the request handling control flow and sends a redirection response to the client.
Implements
Inherited Members
Namespace: EmbedIO
Syntax
public class HttpRedirectException : HttpException, IHttpException
Constructors
HttpRedirectException(String, HttpStatusCode)
Initializes a new instance of the HttpRedirectException class.
Declaration
public HttpRedirectException(string location, HttpStatusCode statusCode)
Parameters
Type | Name | Description |
---|---|---|
String | location | The redirection target. |
HttpStatusCode | statusCode | One of the redirection status codes, to be set on the response. |
HttpRedirectException(String, Int32)
Initializes a new instance of the HttpRedirectException class.
Declaration
public HttpRedirectException(string location, int statusCode = default(int))
Parameters
Type | Name | Description |
---|---|---|
String | location | The redirection target. |
Int32 | statusCode | The status code to set on the response, in the range from 300 to 399. By default, status code 302 ( |
Properties
Location
Gets the URL where the client will be redirected.
Declaration
public string Location { get; }
Property Value
Type | Description |
---|---|
String |
Methods
PrepareResponse(IHttpContext)
Sets necessary headers, as required by the nature
of the HTTP exception (e.g. Location
for
HttpRedirectException).
Declaration
public override void PrepareResponse(IHttpContext context)
Parameters
Type | Name | Description |
---|---|---|
IHttpContext | context | The HTTP context of the response. |
Overrides
Remarks
This method does nothing; there is no need to call
base.PrepareResponse
in overrides of this method.