I am using postman to check my JSON API response from web applicaton to Mobile devices.
Here is my php code.
$checkout = new JsonSynchronization();
$checkout -> customer_id = isset($_POST['customer']) ? $_POST['customer'] : 0;
$checkout -> store_id = isset($_POST['store']) ? $_POST['store'] : 0;
$data ['customer_id'] = $checkout -> customer_id;
$data ['store_id'] = $checkout -> store_id;
echo json_encode($data);
I cant get the response as expected. What is the error?... can you please assist me ?
You are passing parameter in wrong place, Your parameter should go in Body tab. There your parameter will be as a post parameter, the place where you are currently sending is concatenation in URL, which is GET.
You're passing the data along in the URL, so PHP sets the $_GET global, rather than the $_POST. So replace all your $_POST with $_GET. Or if you definitely want to use a POST, then make sure you enter the data as form-data
when you select the POST method in postman. Currently you've got them entered as URL params.