При передаче из Vue.JS ? axios в PHP (POST запрос) ошибка: isAxiosErro
JS
methods:{
timetable_to_db(){
let array_timetable = JSON.stringify(this.all_m)
axios({
method: 'POST',
url: 'header_test.php',
data: array_timetable,
headers: {
'content-type': 'application/json',
'Content-Type': 'application/json;charset=UTF-8',
"Access-Control-Allow-Origin": "*",},
}).then((response) => {
console.log(response);
})
},PHP
header('Access-Control-Allow-Origin: *');
header('Access-Control-Allow-Methods: GET, POST, OPTIONS, PUT, DELETE');
header('Access-Control-Allow-Headers: X-Requested-With,Origin,Content-Type,Cookie,Accept');
if ($_SERVER['REQUEST_METHOD'] === 'OPTIONS') { header('HTTP/1.1 204 No Content'); die; }
$requestBody = file_get_contents('php://input'); print_r(json_encode($requestBody));