Bitrix API

HttpRequest extends Request

Class HttpRequest extends Request. Contains http specific request data.

Table of Contents

Methods

__construct()  : mixed
Creates new HttpRequest object
__unserialize()  : void
addFilter()  : mixed
Applies filter to the http request data. Preserve original values.
clear()  : mixed
decodeJson()  : void
Decodes JSON from application/json requests.
decodeJsonStrict()  : void
get()  : string|array<string|int, mixed>|null
Returns any variable by its name. Null if variable is not set.
getAcceptedLanguages()  : mixed
getCookie()  : null|string
Returns the COOKIES parameter of the current request.
getCookieList()  : ParameterDictionary
Returns the list of COOKIES parameters of the current request.
getCookieRaw()  : mixed
getCookieRawList()  : mixed
getCookiesMode()  : null|string
Returns Y if persistant cookies are enabled, N if disabled, or empty if unknown.
getDecodedUri()  : string
Returns url-decoded and converted to the current encoding URI of the request (except the query string).
getFile()  : string|array<string|int, mixed>|null
Returns the FILES parameter of the current request.
getFileList()  : ParameterDictionary
Returns the list of FILES parameters of the current request.
getHeader()  : null|string
Returns the header of the current request.
getHeaders()  : HttpHeaders
Returns the list of headers of the current request.
getHttpHost()  : string
Returns the host from the server variable without a port number.
getInput()  : bool|string
Returns raw request data from php://input.
getJsonList()  : mixed
getPhpSelf()  : mixed
getPost()  : string|array<string|int, mixed>|null
Returns the POST parameter of the current request.
getPostList()  : ParameterDictionary
Returns the list of POST parameters of the current request.
getQuery()  : null|string|array<string|int, mixed>
Returns the GET parameter of the current request.
getQueryList()  : ParameterDictionary
Returns the list of GET parameters of the current request.
getRaw()  : string|null
Returns original value of any variable by its name. Null if variable is not set.
getRemoteAddress()  : mixed
getRequestedPage()  : string
Returns the current page calculated from the request URI.
getRequestedPageDirectory()  : string
Retuns the current directory with a trailing slash (/).
getRequestMethod()  : mixed
getRequestUri()  : mixed
getScriptFile()  : string
Returns script file possibly corrected by urlrewrite.php.
getScriptName()  : mixed
getServer()  : Server
getServerPort()  : string|null
Returns server port.
getSystemParameters()  : array<string|int, mixed>
Returns the array with predefined query parameters.
getUserAgent()  : null|string
Returns the User-Agent HTTP request header.
getValues()  : array<string|int, mixed>
isAdminSection()  : mixed
isAjaxRequest()  : bool
Returns true if current request is AJAX
isEmpty()  : bool
Returns true if the dictionary is empty.
isHttps()  : mixed
isJson()  : bool
isPost()  : mixed
jsonSerialize()  : array<string|int, mixed>
JsonSerializable::jsonSerialize — Specify data which should be serialized to JSON
modifyByQueryString()  : mixed
offsetSet()  : mixed
Offset to set
offsetUnset()  : void
Offset to unset
set()  : mixed
setValues()  : mixed
toArray()  : array<string|int, mixed>
Returns the values as an array.
toArrayRaw()  : mixed

Methods

__construct()

Creates new HttpRequest object

public __construct(Server $server, array<string|int, mixed> $queryString, array<string|int, mixed> $postData, array<string|int, mixed> $files, array<string|int, mixed> $cookies[, array<string|int, mixed> $jsonData = [] ]) : mixed
Parameters
$server : Server
$queryString : array<string|int, mixed>

_GET

$postData : array<string|int, mixed>

_POST

$files : array<string|int, mixed>

_FILES

$cookies : array<string|int, mixed>

_COOKIE

$jsonData : array<string|int, mixed> = []

__unserialize()

public __unserialize(array<string|int, mixed> $data) : void
Parameters
$data : array<string|int, mixed>

decodeJson()

Decodes JSON from application/json requests.

public decodeJson() : void

decodeJsonStrict()

public decodeJsonStrict() : void

get()

Returns any variable by its name. Null if variable is not set.

public get(string $name) : string|array<string|int, mixed>|null
Parameters
$name : string
Return values
string|array<string|int, mixed>|null

getAcceptedLanguages()

public getAcceptedLanguages() : mixed

getCookie()

Returns the COOKIES parameter of the current request.

public getCookie(mixed $name) : null|string
Parameters
$name : mixed
Return values
null|string

getCookieRaw()

public getCookieRaw(mixed $name) : mixed
Parameters
$name : mixed

getCookieRawList()

public getCookieRawList() : mixed

getCookiesMode()

Returns Y if persistant cookies are enabled, N if disabled, or empty if unknown.

public getCookiesMode() : null|string
Return values
null|string

getDecodedUri()

Returns url-decoded and converted to the current encoding URI of the request (except the query string).

public getDecodedUri() : string
Return values
string

getFile()

Returns the FILES parameter of the current request.

public getFile(mixed $name) : string|array<string|int, mixed>|null
Parameters
$name : mixed
Return values
string|array<string|int, mixed>|null

getHeader()

Returns the header of the current request.

public getHeader(string $name) : null|string
Parameters
$name : string

Name of header.

Return values
null|string

getHttpHost()

Returns the host from the server variable without a port number.

public getHttpHost() : string
Return values
string

getInput()

Returns raw request data from php://input.

public static getInput() : bool|string
Return values
bool|string

getPhpSelf()

public getPhpSelf() : mixed

getPost()

Returns the POST parameter of the current request.

public getPost(mixed $name) : string|array<string|int, mixed>|null
Parameters
$name : mixed
Return values
string|array<string|int, mixed>|null

getQuery()

Returns the GET parameter of the current request.

public getQuery(string $name) : null|string|array<string|int, mixed>
Parameters
$name : string

Parameter name

Return values
null|string|array<string|int, mixed>

getRaw()

Returns original value of any variable by its name. Null if variable is not set.

public getRaw(string $name) : string|null
Parameters
$name : string
Return values
string|null

getRemoteAddress()

public getRemoteAddress() : mixed

getRequestedPage()

Returns the current page calculated from the request URI.

public getRequestedPage() : string
Return values
string

getRequestedPageDirectory()

Retuns the current directory with a trailing slash (/).

public getRequestedPageDirectory() : string
Return values
string

getRequestMethod()

public getRequestMethod() : mixed

getScriptFile()

Returns script file possibly corrected by urlrewrite.php.

public getScriptFile() : string
Return values
string

getScriptName()

public getScriptName() : mixed

getServerPort()

Returns server port.

public getServerPort() : string|null
Return values
string|null

getSystemParameters()

Returns the array with predefined query parameters.

public static getSystemParameters() : array<string|int, mixed>
Return values
array<string|int, mixed>

getUserAgent()

Returns the User-Agent HTTP request header.

public getUserAgent() : null|string
Return values
null|string

getValues()

public getValues() : array<string|int, mixed>
Return values
array<string|int, mixed>

isAdminSection()

public isAdminSection() : mixed

isAjaxRequest()

Returns true if current request is AJAX

public isAjaxRequest() : bool
Return values
bool

isEmpty()

Returns true if the dictionary is empty.

public isEmpty() : bool
Return values
bool

jsonSerialize()

JsonSerializable::jsonSerialize — Specify data which should be serialized to JSON

public jsonSerialize() : array<string|int, mixed>
Attributes
#[ReturnTypeWillChange]
Return values
array<string|int, mixed>

modifyByQueryString()

public modifyByQueryString(mixed $queryString) : mixed
Parameters
$queryString : mixed

offsetSet()

Offset to set

public offsetSet(mixed $offset, mixed $value) : mixed
Parameters
$offset : mixed
$value : mixed

offsetUnset()

Offset to unset

public offsetUnset(mixed $offset) : void
Parameters
$offset : mixed

set()

public set(mixed $name[, mixed $value = null ]) : mixed
Parameters
$name : mixed
$value : mixed = null

toArray()

Returns the values as an array.

public toArray() : array<string|int, mixed>
Return values
array<string|int, mixed>

        
On this page

Search results