fixed Request Method
This commit is contained in:
@@ -25,7 +25,7 @@ function findRowIndex($id, $data) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$entityBody = '{"lastSave": 0, "timeWatchM": 0, "timeWatchW": 0, "timeWatchD": 0, "countWatchM": 0, "countWatchW": 0, "countWatchD": 0, "id":"test","watches":[{"actions":[]},{"actions":[]},{"actions":[]}]}';
|
$entityBody = '{"lastSave": 0, "timeWatchM": 0, "timeWatchW": 0, "timeWatchD": 0, "countWatchM": 0, "countWatchW": 0, "countWatchD": 0, "id":"test","watches":[{"actions":[]},{"actions":[]},{"actions":[]}]}';
|
||||||
if ($_SERVER['REQUEST_METHOD'] !== 'POST') {
|
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||||
$entityBody = file_get_contents('php://input');
|
$entityBody = file_get_contents('php://input');
|
||||||
$entityBodyObject = json_decode($entityBody);
|
$entityBodyObject = json_decode($entityBody);
|
||||||
|
|
||||||
@@ -46,6 +46,8 @@ if ($_SERVER['REQUEST_METHOD'] !== 'POST') {
|
|||||||
write_xlsxFile($fileName, $data);
|
write_xlsxFile($fileName, $data);
|
||||||
echo "<br>Data saved.<br>";
|
echo "<br>Data saved.<br>";
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
echo "invalid Request.<br> Type: ".$_SERVER['REQUEST_METHOD'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user