I'm developing an API REST and I want my code to distinguise between a GET HTTP HEADER and a DELETE HTTP HEADER for returning the information asked or for removind this info from the database.
Thanks.
You can use this:
$_SERVER['REQUEST_METHOD']
Keep in mind that besides PUT and DELETE aren't supported in all browsers and on some server implementations. You can use the Rails way, and pass a _method parameter to a POST/GET call.