How to parse json with fromJson method
- by Ankit HTech
I want to parse my json by fromJson class but I am unable to understand what should be the structure of my class if my json is like below:
String json = "{"Result":{"Status":"SUCCESS","Message":""},"Response":{"Token":"ca0d7507-3907-4eed-af19-ad256bc71088","ZoneUrl":"https:\/\/qa.tritononline.com\/","CustomerID":1,"UserID":29,"DefaultLanguageID":1,"ZoneID":1,"IsTritonIntegrated":false,"Language":[{"LanguageId":1,"Language":"English","IsSelected":false}]}}"
This is what I want to do
Response res = new Response();
Gson gson = new Gson();
res = gson.fromJson(json, Response.class);
I want to know what all variable should I take in Response class.