< /p>
Код: Выделить всё
if(isset($_GET['type']) AND $_GET['type'] == "new")
{
$inputJSON = file_get_contents('php://input');
if($inputJSON)
{
$body = json_decode($inputJSON, true); //convert JSON into array
}
else{
header("HTTP/1.1 403 Bad request");
$response = array(
'status' => 'Error',
'message' => 'Invalid body'
);
}
}
делает все, почему тело всегда пустое? Он должен содержать данные json ..
Подробнее здесь: https://stackoverflow.com/questions/796 ... ways-empty
Мобильная версия