I am passing the Object from fiddler to the service written in codeigniter. My Object is something look like this :
My Response :
{
"GetResponse":{
"OrgName":"adfasd",
"OrgAdr1":"asdf",
"OrgAdr2":"NA",
"ProductList":[
{
"ProductID":8724,
"Pallets":0,
"Pieces":0,
"Description":"sdfsd"
}
]
}
}
What I want :
I want to save the response as a JSON Object in codeigniter and also want to fetch the JSON Object or Array inside the main Object.
What I tried :
My service method in codeigniter is something like this :
public function Save()
{
$Data = json_decode(file_get_contents('php://input'));
echo $Data;
}
But I am getting nothing in Response Body inside Fiddler.
If I use this code :
$Data = file_get_contents('php://input');
echo $Data;
then it is showing me the response but in the form of String. I want to save it as an JSON Object.
Can anyone tell me what am I missing here ?