I need to detect the HTTP method name from module.php file. For this i have tried following code which only gives me GET method,
use Zend\Http\Request;
$getRequest = new Request();
$httpMethod=$getRequest->getMethod();
But in $httpMethod variable i am only getting GET as method name. I am handling errors so in a way i need to detect the which method is being called by my REST Api. Is there any solution for this so i can detect PUT,POST and DELETE method also.
Thanks in advance.