Join 4,000+ others and never miss out on new tips, tutorials, and more.
Latest version:
pecl install openswoole-22.1.2 | composer require openswoole/core:22.1.5
<?php OpenSwoole\Http\Request->post: array
None
Array
The OpenSwoole\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 OpenSwoole\Http\Request->post
instead.
<?php
$server->on('Request', function(OpenSwoole\Server\Request $request, OpenSwoole\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