Unosquare
    Show / Hide Table of Contents

    Class HttpRedirectException

    When thrown, breaks the request handling control flow and sends a redirection response to the client.

    Inheritance
    Object
    HttpException
    HttpRedirectException
    Implements
    IHttpException
    Inherited Members
    HttpException.InternalServerError(String, Object)
    HttpException.Unauthorized(String, Object)
    HttpException.Forbidden(String, Object)
    HttpException.BadRequest(String, Object)
    HttpException.NotFound(String, Object)
    HttpException.MethodNotAllowed(String, Object)
    HttpException.NotAcceptable()
    HttpException.NotAcceptable(String)
    HttpException.RangeNotSatisfiable()
    HttpException.RangeNotSatisfiable(Nullable<Int64>)
    HttpException.Redirect(String)
    HttpException.Redirect(String, Int32)
    HttpException.Redirect(String, HttpStatusCode)
    HttpException.StatusCode
    HttpException.DataObject
    HttpException.IHttpException.Message
    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 (Found) is used.

    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
    HttpException.PrepareResponse(IHttpContext)
    Remarks

    This method does nothing; there is no need to call base.PrepareResponse in overrides of this method.

    Implements

    IHttpException

    Comments

    Back to top Copyright © 2017-2019 Unosquare