Advertisement
Guest User

Lebarbu

a guest
Jun 29th, 2017
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. <?php
  2. // recuperation des infos de la request
  3. $method = $_SERVER ['REQUEST_METHOD'];
  4. $request = isset ($_SERVER ['PATH_INFO']) ? explode('/', trim($_SERVER ['PATH_INFO'], '/')) : null;
  5. $input = json_decode(file_get_contents('php://input'), true);
  6.  
  7.  
  8. $response = [];
  9.  
  10. switch ($method) {
  11. case 'GET' :
  12.  
  13. echo 'GET MEthode';
  14.  
  15. break;
  16. case 'PUT' :
  17.  
  18. echo 'PUT MEthode';
  19.  
  20. break;
  21. case 'POST' :
  22.  
  23. echo 'POST MEthode';
  24.  
  25. break;
  26. case 'DELETE' :
  27.  
  28. echo 'DELETE MEthode';
  29.  
  30. break;
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement