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->header
None
Array
The Swoole\Http\Request->header
is an array which contains the information of HTTP request headers that were sent.
All the array keys are lowercase.
<?php
$server->on('Request', function(Swoole/Server/Request $request, Swoole/Server/Response $response)
{
// Array keys are lowercase
echo $request->header['host'];
echo $request->header['accept-language'];
// See the whole request headers array
var_dump($request->header);
});