Ejemplo n.º 1
0
<?php

include_once "lib/Requests.php";
include_once "lib/RequestHandler.php";
$uri = $_SERVER['REQUEST_URI'];
$uris = explode("/", $uri);
array_shift($uris);
$method = $_SERVER['REQUEST_METHOD'];
$req = new Requests();
$reqHandler = new RequestHandler($uris);
if ($method === "GET" && !empty($uris)) {
    $data = $reqHandler->HandleData();
    $req->response("200", "Name Found", $data);
} else {
    echo "Not found";
}