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->getContent(): string
None
Original POST data request body
Get the raw POST body data from the HTTP request. This method is used to obtain the original POST data which isn't in the form of application/x-www-form-urlencoded
.
You can set the configuration http_parse_post
to control the analysis of POST data, some applications won't require the parsing of POST data, so this give you the ability to turn it off.
Since v4.5.0 this method is available
<?php
$server->on('Request', function(Swoole/Server/Request $request, Swoole/Server/Response $response)
{
var_dump($request->getContent());
});