How to create wordpress request post and response plugin: My idea:
url: www.example.com/apidata/
php:
function apidata()
{
if($_POST['data']==1)
{
$data=array('status'=>1);
echo json_encode($data);
}
else{
$data=array('status'=>0);
echo json_encode($data);
}
}
I ask you to excuse me, I do not know English well
I am not sure if I understand your question correctly - but here goes
You probably want to look at existing wordpress plugins first.
Try to look at e.g. https://wordpress.org/plugins/json-api/