I want to send json payload to my PHP webservice. I am testing on advance rest client. I already search similar answers. But it is not helping me. I am sending this json to my php service which is running on localhost.
{
"name":"XXXX",
"password":"YYYYY"
}
I changed the content-type from dropdown to application/json. However sending value as form parameter from advance rest client works fine.But this is not what i want.
My php code is
$name= isset($_POST['name']) ? mysql_real_escape_string($_POST['name']) : "";
$pass= isset($_POST['pass']) ? mysql_real_escape_string($_POST['pass']) : "";
echo $name;
echo $pass;
but it is always printing the blank value. I am new to php but found this is the way to receive post params.