簡體   English   中英

使用WebService重定向到http地址

[英]Redirecting to http address with webservice

所以我有一種情況,我有一個Web服務,應該接一個呼叫者,然后從呼叫中執行其他操作,然后將呼叫者重定向到特定地址。

public Response myWebservice(jsonObject json)
{
    {
          //Do other stuff
    }
          //Redirect to http://www.myaddress.com/myaddress
}

到目前為止,我已經嘗試使用一些HttpContext.Current.Response.Redirect(“ address”);。 但是它並沒有真正帶我到任何地方,所以我想我想在這里尋求一些指導,可能會使我走得更遠。

試試這個代碼:

public Response myWebservice(jsonObject json)
{
    {
          //Do other stuff
    }
    //Redirect to http://www.myaddress.com/myaddress
    Context.Response.StatusCode = 307;
    Context.Response.AddHeader("Location","http://www.myaddress.com/myaddress");
    return null;
}

在這里這里找到代碼

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM