Table of Contents

Class RedirectResult

Namespace
System.Web.Http.Results
Assembly
System.Web.Http.dll

Represents an action result for a <see cref="F:System.Net.HttpStatusCode.Redirect"/>.

public class RedirectResult : IHttpActionResult
Inheritance
RedirectResult
Implements
Inherited Members

Constructors

RedirectResult(Uri, HttpRequestMessage)

Initializes a new instance of the <see cref="T:System.Web.Http.Results.RedirectResult"/> class with the values provided.

public RedirectResult(Uri location, HttpRequestMessage request)

Parameters

location Uri

The location to which to redirect.

request HttpRequestMessage

The request message which led to this result.

RedirectResult(Uri, ApiController)

Initializes a new instance of the <see cref="T:System.Web.Http.Results.RedirectResult"/> class with the values provided.

public RedirectResult(Uri location, ApiController controller)

Parameters

location Uri

The location to which to redirect.

controller ApiController

The controller from which to obtain the dependencies needed for execution.

Properties

Location

Gets the location at which the content has been created.

public Uri Location { get; }

Property Value

Uri

Returns System.Uri.

Request

Gets the request message which led to this result.

public HttpRequestMessage Request { get; }

Property Value

HttpRequestMessage

Returns HttpRequestMessage.

Methods

ExecuteAsync(CancellationToken)

public virtual Task<HttpResponseMessage> ExecuteAsync(CancellationToken cancellationToken)

Parameters

cancellationToken CancellationToken

Returns

Task<HttpResponseMessage>

Returns Task<TResult>.