actually I am doing redirect from one play application to another play application, finally I receive response as Result object.. Below is the action in two applications. I am redirecting from apllication1 to application2. Application 2 will return JSON string, that I need to extract.
How can I retrieve JSON content from Result object?
Application1:
public static Result redirectTest(){
Result result = redirect("http://ipaddress:9000/authenticate");
/*** here I would like to extract JSON string from result***/
return result;
}
Application2:
@SecuredAction
public static Result index() {
Map<String, String> response = new HashMap<String, String>();
DemoUser user = (DemoUser) ctx().args.get(SecureSocial.USER_KEY);
for(BasicProfile basicProfile: user.identities){
response.put("name", basicProfile.firstName().get());
response.put("emailId", basicProfile.email().get());
response.put("providerId", basicProfile.providerId());
response.put("avatarurl", basicProfile.avatarUrl().get());
}
return ok(new JSONObject(response).toString());
}