2017-03-05 27 views
0

我使用cordova azure移動應用程序插件來連接到我的azure移動應用程序,我有一個自定義API,我想從科爾多瓦客戶端調用它,但帶有參數。使用科爾多瓦撥打azure移動應用程序自定義api

我看到後How to call a custom function of Azure Mobile Service from Cordova mobile app?

,這是有益的,但它demonistrate不帶參數

我希望有關於如何配置我的客戶打電話給我定製的API和發送參數給它的幫助下,主叫

我自定義的API是像

[MobileAppController] 
    public class AirportsController : ApiController 
    { 
     public string GetByCode(int Code) 
     { 
      return Code.ToString(); 
     } 
    } 

在我的科爾多瓦客戶端應該是這樣的:

client = new WindowsAzure.MobileServiceClient('https://MYAZURESITE.azurewebsites.net'); 
client.invokeApi('Airports/GetByCode', { method: 'GET' }).then(createKeySuccess, createKeyFailure); 

那麼,我可以把我的參數值?

回答

相關問題