【发布时间】:2017-07-25 05:43:49
【问题描述】:
我正在使用 cordova azure 移动应用程序插件连接到我的 azure 移动应用程序,我有一个自定义 api,我想从 cordova 客户端调用它,但带有参数。
我看到帖子How to call a custom function of Azure Mobile Service from Cordova mobile app?
这很有帮助,但它证明了没有参数的调用
我希望对如何配置我的客户端以调用我的自定义 api 并向其发送参数有所帮助
我的自定义 api 是这样的
[MobileAppController]
public class AirportsController : ApiController
{
public string GetByCode(int Code)
{
return Code.ToString();
}
}
我的 cordova 客户端应该是这样的:
client = new WindowsAzure.MobileServiceClient('https://MYAZURESITE.azurewebsites.net');
client.invokeApi('Airports/GetByCode', { method: 'GET' }).then(createKeySuccess, createKeyFailure);
那么我可以在哪里设置参数值?
【问题讨论】:
标签: cordova azure azure-mobile-services