Join 4,000+ others and never miss out on new tips, tutorials, and more.
4.x is outdated, please check the latest version 22.x
Latest version:
pecl install openswoole-22.1.2
<?php Swoole\Http\Request->getMethod(): string
None
Returns the current request HTTP method as a string
Gets the method of HTTP request, so it could be GET
, POST
, PUT
, DELETE
etc.
Since version v4.6.2
<?php
$server->on('Request', function(Swoole/Server/Request $request, Swoole/Server/Response $response)
{
var_dump($request->server['request_method']);
var_dump($request->getMethod());
});