Skip to content

Instantly share code, notes, and snippets.

@erikfig
Created July 3, 2015 00:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save erikfig/23de6d17cb8c18c09f09 to your computer and use it in GitHub Desktop.
Save erikfig/23de6d17cb8c18c09f09 to your computer and use it in GitHub Desktop.
/users/
/users/2
GET
POST
PUT
DELETE
- /users/2 - GET - Retornar 1 usuário
- /users/ - GET - Retornar varios usuários
- /users/2 - PUT/POST - Atualizar um usuário
- /users/ - POST - Inserir um usuário
- /users/2 - DELETE - Remover um usuário
//Slim
$app->request->isPost() || $app->request->isPut()
// PHP
$request_type = [
'POST',
'PUT'
]
in_array($_SERVER['REQUEST_METHOD'], $request_type)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment