Join 4,000+ others and never miss out on new tips, tutorials, and more.
4.x is outdated, please check the latest version 25.x
Latest version:
pecl install openswoole-25.2.0
<?php Swoole\Http\Request->post: array
None
Array
The Swoole\Http\Request->post
is an array which contains POST data from the HTTP request. This array is equivalent to the PHP super global $_POST
variable, you should use Swoole\Http\Request->post
instead.
<?php
$server->on('Request', function(Swoole/Server/Request $request, Swoole/Server/Response $response)
{
// Access one POST parameter
echo $request->post['hello'];
// See the whole request POST array
var_dump($request->post);
});
The POST and Header size combined must not exceed package_max_length
otherwise the server won't be able to process the request and will consider it malicious
The POST parameters must not exceed 128