[英].net core web api redirect home page to mvc project in same solution
I have .net core web api solution, in the same solution I have mvc project that contains my home page template, how to redirect my web api controller to the home page in mvc project?? 我看到了这个,但我不知道该怎么做。
public HttpResponseMessage Get()
{
// ... do the job
// now redirect
var response = Request.CreateResponse(HttpStatusCode.Moved);
response.Headers.Location = new Uri("http://www.abcmvc.com");
return response;
}
I have .net core web api solution, in the same solution I have mvc project that contains my home page template, how to redirect my web api controller to the home page in mvc project?? 我看到了这个,但我不知道该怎么做。
public HttpResponseMessage Get()
{
// ... do the job
// now redirect
var response = Request.CreateResponse(HttpStatusCode.Moved);
response.Headers.Location = new Uri("http://www.abcmvc.com");
return response;
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.