public function ServerRequest::getMethod in Zircon Profile 8.0
Same name in this branch
- 8.0 vendor/zendframework/zend-diactoros/src/ServerRequest.php \Zend\Diactoros\ServerRequest::getMethod()
- 8.0 vendor/symfony/psr-http-message-bridge/Tests/Fixtures/ServerRequest.php \Symfony\Bridge\PsrHttpMessage\Tests\Fixtures\ServerRequest::getMethod()
Same name and namespace in other branches
- 8 vendor/zendframework/zend-diactoros/src/ServerRequest.php \Zend\Diactoros\ServerRequest::getMethod()
Proxy to receive the request method.
This overrides the parent functionality to ensure the method is never empty; if no method is present, it returns 'GET'.
Return value
string
Overrides RequestInterface::getMethod
File
- vendor/
zendframework/ zend-diactoros/ src/ ServerRequest.php, line 223
Class
- ServerRequest
- Server-side HTTP request
Namespace
Zend\DiactorosCode
public function getMethod() {
if (empty($this->method)) {
return 'GET';
}
return $this->method;
}