2017-09-25 78 views

回答

0

您可以創建一個API來接受來自WebJob的響應。以下代碼供您參考。

public class WebJobResponseController : ApiController 
{ 
    public string Get(string token, string value) 
    { 
     //use the token to validate the webjob, use the value to post any data which you want to send to API 
     return "success"; 
    } 
} 

在您的WebJob端,處理完作業之後,您只需向上層API發送請求。以下代碼供您參考。

HttpClient client = new HttpClient(); 
client.BaseAddress = new Uri("URL of your API"); 
await client.GetAsync("WebJobResponse?token=token1&value=value1"); 
+0

有沒有更新?如果您還有其他相關問題,請隨時告訴我。 – Amor

相關問題