I am getting JSON Object when their is only one response(items) or JSON Array response but i want to array and object response.How to handle JSON Response?
JSON ARRAY when their is more than one items.And JSON OBJECT when their is only one items
.
{
"product":[
{
"items":[
{
"name":"foo",
"title":"toy"
},
{
"name":"foo",
"title":"toy"
}
]
},
{ "items":
{
"name":"foo",
"title":"toy"
}
}
]
}