parent
7adff9649a
commit
5b644e2ff5
@ -0,0 +1,12 @@
|
|||||||
|
<?php
|
||||||
|
header('Content-Type: application/json');
|
||||||
|
include 'data/people.php';
|
||||||
|
|
||||||
|
$requestBody = file_get_contents('php://input');
|
||||||
|
$body = json_decode($requestBody);
|
||||||
|
$zagthar = new Person($body->name, $body->age);
|
||||||
|
|
||||||
|
$people[$_REQUEST['id']] = $zagthar;
|
||||||
|
|
||||||
|
echo json_encode($people);
|
||||||
|
?>
|
||||||
Loading…
Reference in new issue