更新时间:2022-06-12 22:48:03
问题出在您的PHP代码中。试试这个:
<?php
$data = file_get_contents('php://input');
$json_data = json_decode($data , true);
if ($_SERVER['REQUEST_METHOD'] === 'POST')
{
//code to process data
if ($data == "" || empty($json_data['user_id']) || empty($json_data['password']))
{
$response = array('status' => false, 'message' => 'Invalid Values');
}
else
{
$response = array('status' => true,'message' => 'success');
}
echo json_encode($response);
}
?>