Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // recuperation des infos de la request
- $method = $_SERVER ['REQUEST_METHOD'];
- $request = isset ($_SERVER ['PATH_INFO']) ? explode('/', trim($_SERVER ['PATH_INFO'], '/')) : null;
- $input = json_decode(file_get_contents('php://input'), true);
- $response = [];
- switch ($method) {
- case 'GET' :
- echo 'GET MEthode';
- break;
- case 'PUT' :
- echo 'PUT MEthode';
- break;
- case 'POST' :
- echo 'POST MEthode';
- break;
- case 'DELETE' :
- echo 'DELETE MEthode';
- break;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement