I am calling an api , On success I am getting json data in List format
[
{
"fileName": [
"file1"
],
"date": [
"8/25/2015 0:00"
],
"time": [
"7/16/2009 16:51"
],
"id": "1",
"version_": 1},
{
"fileName": [
"file1"
],
"date": [
"8/25/2015 0:00"
],
"time": [
"7/16/2009 16:51"
],
"id": "1",
"version_": 1
}
]
On error,When I am passing wrong data,response is in pure json format
{
"resultType": "error",
"errorType": "validationError",
"errorCode": "validation.error",
"apiMessage": "Data Validation issue, please correct the data and try again",
"validationErrors": [
{
"errorCode": "100211",
"path": "firstName",
"apiMessage": "Minimum field length not reached"
},
{
"errorCode": "100241",
"path": "firstName",
"apiMessage": "Names must have at least one alphabetic character"
}
],
"requestId": "3f6fb4b5-42a9-44e5-9ed3-6a50c6fdcc52"
}
When no data is present I am getting
<Empty JSON content>
How can I handle all these when I am getting the response