IOS与InvokeAPI和移动服务自定义API之间传递variables
我可以在iOS上使用InbokeAPI方法在自定义API中执行快速SQL查询,但是如何在iOS和CustomAPI中的SQL查询之间传递variables,以便我可以selectID行?
当你调用invoke API时,你可以传递一个JSON对象作为正文。 在你的服务器端脚本中,你可以把这个值拉出来,并用它作为sql查询的参数。 所以在客户端,你可以这样做:
NSDictionary *postValues = @{ @"myParam": @"myValue"}; [self.client invokeAPI:@"myAPI" body:postValues
然后在你的自定义API脚本的服务器端,你可以这样做:
var value = request.body.myParam; var sql = "SELECT * FROM Table WHERE Column = ?"; var mssql = request.service.mssql; mssql.queryRaw(sql, [value], { success: function(results) { //do stuff for success }, error: function(error) { //do stuff for error });
- 我需要Mac开发Azure Xamarin.iOS应用程序吗?
- SBNotificationHub仅在Testflight Beta版本发行版中从registerTemplateWithDeviceToken返回时崩溃
- Azure Notification Hub似乎不适用于ios 10和swift 3
- Azure应用程序服务 – 脱机同步 – PullAsync事务
- 将Azure ADAL库添加到iOS本机应用程序时,资源束的问题
- 来自IOS Xcode的Azure推送通知错误
- 如何使用Azure移动服务APIfunction
- Swift 3中的Microsoft Azure远程通知
- 诊断从Azure通知集线器丢弃的通知到APNS