I know that every HTTP request made, either by the browser or another resource, sends a certain method ( GET
, POST
, PUT
, DELETE
and so on).
I'm thinking of building a Restful application with PHP, but I do not know how I can do it to find out what the current request method is, so I can validate it.
If it is a GET
request in a url that only accepts POST
, I want to return Error 405
, which is método não aceitável
.
How to know the current request method by PHP?