Right now , I am working on a project. I have to build some rest full api’s for android application using Woo-Commerce CLIENT REST API.
Everything is working fine, but the data i’m getting is unnecessary. So can anybody tell me, how to overcome from this problem.
e.g. I am getting this data
{
product_categories: [
{
id: 8,
name: "Cakes",
slug: "cakes",
parent: 0,
description: "Love is like a good cake; you never know when it's coming, but you'd better eat it when it does!",
count: 11
},
{
id: 9,
name: "Breads",
slug: "breads",
parent: 0,
description: "All sorrows are less with bread. ",
count: 3
},
{
id: 10,
name: "Pastries",
slug: "pastries",
parent: 0,
description: "I'm not a vegetarian! I'm a pastries-ian!",
count: 6
}
but i do not want slug,parent, description parameters.
Thanks in advance.
Your Problems is
" "
missing in keyEx: "ID", "name"
andYou use this function
json_pretty()
for json format.