Documentation

request
in package

Table of Contents

$files  : ParamStore
$get  : ParamStore
$headers  : ParamStore
$params  : ParamStore
$post  : ParamStore
$url  : array<string|int, mixed>|string|array<string|int, string>|null
$body  : mixed
$method  : string
$prepared_body  : mixed
$protocol_version  : string
__construct()  : mixed
The constructor of the class.
buildPostBody()  : string
Generating a boundary for the multipart/form-data request.
createFromGlobals()  : request
Detecting the content type of the request.
getMethod()  : string
A getter method for the `$method` property.
getProtocolVersion()  : string
A getter method for the `$protocol_version` property.
getRawBody()  : string
Returning the prepared body of the request.
getRawHeaders()  : string
Getting the raw headers of the request.
getUri()  : mixed
An alias for `public function getUrl()`.
getUrl()  : string
A getter method for the `$url` property.
parseQuery()  : array<string|int, mixed>
Parsing a query string into an array.
prepare()  : void
Setting the body of the request.
setBody()  : void
A method that is called by the wrapper class.
setMethod()  : void
Setting the method of the request.
setUrl()  : void
Setting the URL of the request.
detectContentType()  : string
Building the body of the request.
generateBoundary()  : string
Preparing the body of the request.

Properties

$url

public array<string|int, mixed>|string|array<string|int, string>|null $url

$prepared_body

private mixed $prepared_body

$protocol_version

private string $protocol_version = '1.1'

Methods

__construct()

The constructor of the class.

public __construct(mixed $method, mixed $url[, mixed $body = null ]) : mixed
Parameters
$method : mixed
$url : mixed
$body : mixed = null
Return values
mixed

buildPostBody()

Generating a boundary for the multipart/form-data request.

public static buildPostBody(mixed $fields, mixed $files[, mixed $boundary = null ]) : string
Parameters
$fields : mixed
$files : mixed
$boundary : mixed = null
Return values
string

createFromGlobals()

Detecting the content type of the request.

public static createFromGlobals() : request
Return values
request

getMethod()

A getter method for the `$method` property.

public getMethod() : string
Return values
string

getProtocolVersion()

A getter method for the `$protocol_version` property.

public getProtocolVersion() : string
Return values
string

getRawBody()

Returning the prepared body of the request.

public getRawBody() : string
Return values
string

getRawHeaders()

Getting the raw headers of the request.

public getRawHeaders() : string
Return values
string

getUri()

An alias for `public function getUrl()`.

public getUri() : mixed
Return values
mixed

getUrl()

A getter method for the `$url` property.

public getUrl() : string
Return values
string

parseQuery()

Parsing a query string into an array.

public static parseQuery(mixed $query) : array<string|int, mixed>
Parameters
$query : mixed
Return values
array<string|int, mixed>

prepare()

Setting the body of the request.

public prepare() : void
Return values
void

setBody()

A method that is called by the wrapper class.

public setBody(mixed $body, mixed $content_type) : void
Parameters
$body : mixed
$content_type : mixed
Return values
void

setMethod()

Setting the method of the request.

public setMethod(mixed $method) : void
Parameters
$method : mixed
Return values
void

setUrl()

Setting the URL of the request.

public setUrl(mixed $url) : void
Parameters
$url : mixed
Return values
void

detectContentType()

Building the body of the request.

private detectContentType(mixed $data) : string
Parameters
$data : mixed
Return values
string

generateBoundary()

Preparing the body of the request.

private static generateBoundary() : string
Return values
string

Search results