Redirect from asp.net web api post action

前端 未结 4 932
深忆病人
深忆病人 2020-11-27 14:05

I\'m very new to ASP.NET 4.0 Web API. Can we redirect to another URL at the end of the POST action?, something like ... Response.Redirect(url)

Actually

4条回答
  •  时光说笑
    2020-11-27 14:09

    You can check this

    [Route("Report/MyReport")]
    public IHttpActionResult GetReport()
    {
    
       string url = "https://localhost:44305/Templates/ReportPage.html";
    
       System.Uri uri = new System.Uri(url);
    
       return Redirect(uri);
    }
    

提交回复
热议问题