Class RedirectResult
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
locationUriThe location to which to redirect.
requestHttpRequestMessageThe 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
locationUriThe location to which to redirect.
controllerApiControllerThe 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
cancellationTokenCancellationToken
Returns
- Task<HttpResponseMessage>
Returns Task<TResult>.