Playframework 在两个播放应用程序之间发送和接收Json数据

Playframework 在两个播放应用程序之间发送和接收Json数据,playframework,playframework-2.0,Playframework,Playframework 2.0,这两个应用程序都是在Play 2.0.4中编写的 用于发送Json文件的应用程序: @BodyParser.Of(play.mvc.BodyParser.Json.class) public static Result getJson() { ObjectNode result = Json.newObject(); try { result.put("Backend",toJson()); return

这两个应用程序都是在Play 2.0.4中编写的
用于发送Json文件的应用程序:

@BodyParser.Of(play.mvc.BodyParser.Json.class)
    public static Result getJson() {

        ObjectNode result = Json.newObject();

        try {
            result.put("Backend",toJson());
            return ok(result);
        } catch (Exception ex) {
            System.out.println("Exception: " + ex.getMessage());
        }

        return ok(result);

    }

URL:localhost:80/GetJson->HTML输出:{“状态”:“确定”,“消息”:“Hello Guillaume”}
有人能告诉我如何从其他play应用程序获取json数据吗?(使用POST请求)。基本上,第一个应用程序可以使用第二个应用程序的POST请求将Json文件提供给第二个应用程序,或者第二个应用程序可以使用get请求从第一个应用程序获取Json数据。
非常感谢。
P/S我读了剧本的文档,但老实说,我不理解这个角色

因为您只是从另一个应用程序获取json字符串,而不是修改服务器的状态,所以应该使用“GET”请求。您可以使用在config/routes中映射到此api的任何端点来测试此api。

因为您只是从另一个应用程序获取json字符串,而不是修改服务器的状态,所以应该使用“GET”请求。