How can I detect which request type was used (GET, POST, PUT or DELETE) in PHP?
We can also use the input_filter to detect the request method while also providing security through input sanitation.
$request = filter_input(INPUT_SERVER, 'REQUEST_METHOD', FILTER_SANITIZE_ENCODED);