I'm trying to fill my JSONObject like this:
JSONObject json = new JSONObject();
json.put("Command", "CreateNewUser");
json.put("User", user);
user
is instance of basic class that contains fields like "FirstName", "LastName" etc.
Looks like I'm doing it wrong, because I get JSON like this:
{
"Command":"CreateNewUser",
"User":"my.package.name.classes.User@2686a150"
}
instead of "tree".
What is wrong with my code?