IRequest
interface IRequest
HTTP request provides access scheme for request sent via HTTP.
Constants
Get |
HTTP request method |
Post |
HTTP request method |
Head |
HTTP request method |
Put |
HTTP request method |
Delete |
HTTP request method |
Patch |
HTTP request method |
Options |
HTTP request method |
deprecated GET |
|
deprecated POST |
|
deprecated HEAD |
|
deprecated PUT |
|
deprecated DELETE |
|
deprecated PATCH |
|
deprecated OPTIONS |
|
Methods
Returns variable provided to the script via URL query ($_GET).
Returns variable provided to the script via POST method ($_POST).
Returns uploaded file.
Returns uploaded files.
Returns variable provided to the script via HTTP cookies.
Returns variables provided to the script via HTTP cookies.
Returns HTTP request method (GET, POST, HEAD, PUT, ...). The method is case-sensitive.
Checks HTTP request method.
Return the value of the HTTP header. Pass the header name as the plain, HTTP-specified header name (e.g. 'Accept-Encoding').
Returns all HTTP headers.
Is the request sent via secure channel (https)?
Is AJAX request?
Returns the IP address of the remote client.
Returns the host of the remote client.
Returns raw content of HTTP request body.
Returns referrer.
Is the request sent from the same origin?
Details
at line 54
UrlScript
getUrl()
Returns URL object.
at line 63
mixed
getQuery(string|null $key = null)
Returns variable provided to the script via URL query ($_GET).
If no key is passed, returns the entire array.
at line 70
mixed
getPost(string|null $key = null)
Returns variable provided to the script via POST method ($_POST).
If no key is passed, returns the entire array.
at line 76
FileUpload|array|null
getFile(string $key)
Returns uploaded file.
at line 81
array
getFiles()
Returns uploaded files.
at line 87
mixed
getCookie(string $key)
Returns variable provided to the script via HTTP cookies.
at line 92
array
getCookies()
Returns variables provided to the script via HTTP cookies.
at line 99
string
getMethod()
Returns HTTP request method (GET, POST, HEAD, PUT, ...). The method is case-sensitive.
at line 104
bool
isMethod(string $method)
Checks HTTP request method.
at line 110
string|null
getHeader(string $header)
Return the value of the HTTP header. Pass the header name as the plain, HTTP-specified header name (e.g. 'Accept-Encoding').
at line 115
array
getHeaders()
Returns all HTTP headers.
at line 120
bool
isSecured()
Is the request sent via secure channel (https)?
at line 125
bool
isAjax()
Is AJAX request?
at line 130
string|null
getRemoteAddress()
Returns the IP address of the remote client.
at line 135
string|null
getRemoteHost()
Returns the host of the remote client.
at line 140
string|null
getRawBody()
Returns raw content of HTTP request body.
at line 18
UrlImmutable|null
getReferer()
Returns referrer.
at line 18
bool
isSameSite()
Is the request sent from the same origin?