class HTTPRequestBuilder

Methods

static HTTPRequest
createFromEnvironment()

Create HTTPRequest instance from the current environment variables.

static HTTPRequest
createFromVariables(array $variables, string $input, string|null $url = null)

Build HTTPRequest from given variables

static array
extractRequestHeaders(array $server)

Takes a $_SERVER data array and extracts HTTP request headers.

static array
cleanEnvironment(array $variables)

Clean up HTTP global vars for $_GET / $_REQUEST prior to bootstrapping

Details

at line 16
static HTTPRequest createFromEnvironment()

Create HTTPRequest instance from the current environment variables.

May throw errors if request is invalid.

Return Value

HTTPRequest

Exceptions

HTTPResponse_Exception

at line 34
static HTTPRequest createFromVariables(array $variables, string $input, string|null $url = null)

Build HTTPRequest from given variables

Parameters

array $variables
string $input Request body
string|null $url Provide specific url (relative to base)

Return Value

HTTPRequest

at line 87
static array extractRequestHeaders(array $server)

Takes a $_SERVER data array and extracts HTTP request headers.

Parameters

array $server

Return Value

array

at line 136
static array cleanEnvironment(array $variables)

Clean up HTTP global vars for $_GET / $_REQUEST prior to bootstrapping

Parameters

array $variables

Return Value

array Cleaned variables