I am trying to parse a JSON response from a server, If there are changes to in the query sent in post method I will get first one as response, if not I will get the second o
You cannot use like that. You have a status
field in the response. Use the status
filed to check for any data present. for example :
if the status is 1:
{
"status": 1,
"data": {
"firstname": "First Name",
"lastname": "Last Name",
"mobilenumber": "1234567894",
"emailid": "test@gmail.com",
"timezone": "Asia/Kolkata"
},
"user_id": "",
"response": "Profile Updated Successfully"
}
and if the status
is 0 :
{
"status": 0,
"data": {
"firstname": "",
"lastname": "",
"mobilenumber": "",
"emailid": "",
"timezone": ""
},
"user_id": "",
"response": "An error message"
}