Swoole\HTTP\Request->create

Version: Swoole: 4.6.0+

Declaration

<?php
Swoole\HTTP\Request->create

Parameters

options

HTTP request options

Swoole\Http\Request|false

Swoole HTTP Request Object or false

Return

Description

Build a HTTP request object from scratch, this give you much more flexibility when passing the HTTP request object either to a downstream service or frameworks.

The options of HTTP request creation:

<?php
Swoole\HTTP\Request->create([
    'parse_cookie' => true,
]);

parse_body

<?php
Swoole\HTTP\Request->create([
    'parse_body' => true,
]);

parse_files

<?php
Swoole\HTTP\Request->create([
    'parse_files' => true,
]);

enable_compression

<?php
Swoole\HTTP\Request->create([
    'parse_files' => true,
]);

compression_level

<?php
Swoole\HTTP\Request->create([
    'compression_level' => 1,
]);