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->header
None
Array
The OpenSwoole\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(OpenSwoole\Server\Request $request, OpenSwoole\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);
});