36293-vm/test_save.php
2025-11-26 14:15:17 +00:00

28 lines
596 B
PHP

<?php
$url = 'http://localhost/save_override.php';
$data = [
'project_id' => 25,
'overrides' => [
['month' => '2025-11-01', 'nsr' => 1000, 'cost' => 500],
['month' => '2025-12-01', 'nsr' => 2000, 'cost' => 1000],
]
];
$options = [
'http' => [
'header' => "Content-type: application/json\r\n",
'method' => 'POST',
'content' => json_encode($data),
],
];
$context = stream_context_create($options);
$result = file_get_contents($url, false, $context);
if ($result === FALSE) {
echo "Error fetching URL";
}
var_dump($result);
?>