{'greeting': 'Hello, Susan'} |
https://openwhisk.ng.bluemix.net/api/v1/web/devworkssandbox_pub/270003KAD5/0-1003.json |
{ "greeting": "Hello, Susan" } |
import com.google.gson.JsonObject; import com.google.gson.JsonParser; // Other imports here public class MyClass { public static JsonObject main(JsonObject args) { // Parse the args JsonObject so we can work with it // Use the Google gson library to create a JsonObject with the // appropriate output JsonObject returnObject = ...; return returnObject; } } |
private static String data = "{'name': 'Susan'}"; public static void main(String[] args) { JsonObject jsonArgs = new JsonParser().parse(data).getAsJsonObject(); main(jsonArgs); } |
欢迎光临 电子技术论坛_中国专业的电子工程师学习交流社区-中电网技术论坛 (http://bbs.eccn.com/) | Powered by Discuz! 7.0.0 |