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->create(string $options): OpenSwoole\Http\Request|false
An array of HTTP request options to set
OpenSwoole\Http\Request or false
Create a new HTTP request object from scratch, this give you much more flexibility when passing the HTTP request object either to a downstream service or framework.
You are recreating the request object from OpenSwoole\Http\Request
that was given to you from the server, not an actual new request.
Since version 4.6.0+
<?php
OpenSwoole\HTTP\Request->create([
'parse_cookie' => true,
]);
Sets whether to resolve any HTTP cookies.
<?php
OpenSwoole\HTTP\Request->create([
'parse_body' => true,
]);
Sets whether to resolve the HTTP POST body.
<?php
OpenSwoole\HTTP\Request->create([
'parse_files' => true,
]);
Sets whether to resolve any HTTP files that were sent to the server.
<?php
OpenSwoole\HTTP\Request->create([
'enable_compression' => true,
]);
Sets whether to enable compression or not.
<?php
OpenSwoole\HTTP\Request->create([
'compression_level' => 1,
]);
Sets the compression level, from 1-9, the higher the smaller the request size but more CPU usage.