How to Redirect in ASPNET Web API

 

You could set the Location header:

public HttpResponseMessage Get()

{

var response = Request.CreateResponse(HttpStatusCode.Found);

response.Headers.Location = new Uri("http://www.google.com");

return response;

}

原文地址:https://www.cnblogs.com/time-is-life/p/6519581.html