【发布时间】:2016-06-30 23:07:56
【问题描述】:
我对 bluemix mobilefirst 平台还很陌生,并且停留在需要使用来自 android 客户端的一些参数进行发布请求的地方。我已经搜索了文档,但找不到所需的。
【问题讨论】:
标签: android node.js server ibm-cloud
我对 bluemix mobilefirst 平台还很陌生,并且停留在需要使用来自 android 客户端的一些参数进行发布请求的地方。我已经搜索了文档,但找不到所需的。
【问题讨论】:
标签: android node.js server ibm-cloud
显然,发送 POST 请求的方法不止一种,我将概述其中一种。
为了查看端到端场景,您可以使用 HelloTodo Android 示例,该示例使用基于 node.js 的 Bluemix 托管后端 - https://github.com/ibm-bluemix-mobile-services/bms-samples-android-hellotodo。
此 Android 示例中的 POST 请求是使用 Request 类发出的,它是 Bluemix 移动服务 SDK 的一部分 - https://github.com/ibm-bluemix-mobile-services/bms-samples-android-hellotodo/blob/master/helloTodo/app/src/main/java/com/ibm/hellotodo/MainActivity.java#L255
服务器端实现取决于您选择使用的框架。最流行的 nodejs 框架可能是 expressjs - http://expressjs.com/en/4x/api.html#app.post.method
【讨论】: