IBM bluemix:从Android发出POST请求以及如何在NodeJS中处理它 [英] IBM bluemix : make POST request from Android and how to handle it in NodeJS
问题描述
我对bluemix mobilefirst格式相当陌生,并停留在需要从android客户端发出带有一些参数的发布请求的地方.我已经搜索了文档,但找不到所需的文档.
I am fairly new to the bluemix mobilefirst paltform and stuck at the point where I need to make post request with some parameters from the android client side. I have searched the documentation but not able to find the required .
推荐答案
很显然,发送POST请求有多种方法,我将概述其中之一.
Obviously there is more than one way to send POST requests, I'll outline one of them.
为了查看端到端场景,您可以使用HelloTodo Android示例,该示例使用基于node.js的Bluemix托管后端-
In order to see end-to-end scenario you can use the HelloTodo Android sample, which uses node.js based Bluemix hosted backend - https://github.com/ibm-bluemix-mobile-services/bms-samples-android-hellotodo.
此Android示例中的POST请求是使用Request类发出的,该类是Bluemix Mobile Services SDK的一部分-
A POST request in this Android sample is made using Request class, which is part of Bluemix Mobile Services 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
Server side implementation depends on which framework you chose to use. The most popular nodejs framework would probably be expressjs - http://expressjs.com/en/4x/api.html#app.post.method
这篇关于IBM bluemix:从Android发出POST请求以及如何在NodeJS中处理它的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!