Class Request
An HTTP request.
<?php use ICanBoogie\HTTP\Request; # Creating the main request $request = Request::from($_SERVER); # Creating a request from scratch, with the current environment. $request = Request::from([ 'uri' => '/path/to/my/page.html?page=2', 'user_agent' => 'Mozilla' 'is_get' => true, 'is_xhr' => true, 'is_local' => true ], $_SERVER);
- ICanBoogie\HTTP\Request implements ArrayAccess, IteratorAggregate uses ICanBoogie\Accessor\AccessorTrait (not available)
See: http://en.wikipedia.org/wiki/Uniform_resource_locator
Located at Request.php
Methods summary
protected static
Closure[]
|
|
protected static
Closure[]
|
|
public static
|
|
protected
|
|
public static
|
|
protected static
|
|
protected static
|
|
protected static
|
|
protected
|
#
__construct( array $properties, array $env = [] )
Initialize the properties |
public
|
|
public
|
|
public
|
|
protected
|
|
public
|
|
protected
|
|
public
mixed
|
|
public
boolean
|
|
public
mixed|null
|
|
public
|
|
public
|
|
public
ArrayIterator
|
|
protected
|
|
protected
|
|
protected
|
|
protected
string
|
|
protected
string
|
|
protected
string|null
|
|
protected
integer|null
|
|
protected
string|null
|
|
protected
string|null
|
|
protected
boolean
|
|
protected
boolean
|
|
protected
boolean
|
|
protected
boolean
|
|
protected
boolean
|
|
protected
boolean
|
|
protected
boolean
|
|
protected
boolean
|
|
protected
boolean
|
|
protected
boolean
|
|
protected
string
|
|
protected
|
|
protected
string
|
|
protected
integer
|
|
protected
string
|
|
protected
string
|
#
get_normalized_path( )
Returns the $path property normalized using the \ICanBoogie\normalize_url_path() function. |
protected
mixed
|
|
protected
|
|
protected
array
|
#
lazy_get_params( )
Returns the union of the |
Magic methods summary
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
Constants summary
string |
METHOD_ANY
|
#
'ANY'
|
string |
METHOD_CONNECT
|
#
'CONNECT'
|
string |
METHOD_DELETE
|
#
'DELETE'
|
string |
METHOD_GET
|
#
'GET'
|
string |
METHOD_HEAD
|
#
'HEAD'
|
string |
METHOD_OPTIONS
|
#
'OPTIONS'
|
string |
METHOD_POST
|
#
'POST'
|
string |
METHOD_PUT
|
#
'PUT'
|
string |
METHOD_PATCH
|
#
'PATCH'
|
string |
METHOD_TRACE
|
#
'TRACE'
|
Properties summary
public static
array
|
$methods
|
#
[
self::METHOD_CONNECT,
self::METHOD_DELETE,
self::METHOD_GET,
self::METHOD_HEAD,
self::METHOD_OPTIONS,
self::METHOD_POST,
self::METHOD_PUT,
self::METHOD_PATCH,
self::METHOD_TRACE
]
|
protected static
|
$current_request
Current request. |
|
public
array
|
$path_params
Parameters extracted from the request path. |
#
[]
|
public
array
|
$query_params
Parameters defined by the query string. |
#
[]
|
public
array
|
$request_params
Parameters defined by the request body. |
#
[]
|
public
array
|
$params | |
protected
|
$context
General purpose container. |
|
public
|
$headers
The headers of the request. |
|
protected
array
|
$env
Request environment. |
|
protected
|
$files
Files associated with the request. |
|
public
|
$cookie
|
|
protected
|
$parent
Parent request. |
Magic properties
public read-only
|
$context
the request's context. |
public read-only
|
$parent
Parent request. |
public read-only
|
$files
The files associated with the request. |
public read-only
boolean
|
$authorization
Authorization of the request. |
public read-only
integer
|
$content_length
Length of the request content. |
public read-only
|
$cache_control
|
public read-only
string
|
$ip
Remote IP of the request. |
public read-only
boolean
|
$is_delete
Is this a |
public read-only
boolean
|
$is_get
Is this a |
public read-only
boolean
|
$is_head
Is this a |
public read-only
boolean
|
$is_options
Is this a |
public read-only
boolean
|
$is_patch
Is this a |
public read-only
boolean
|
$is_post
Is this a |
public read-only
boolean
|
$is_put
Is this a |
public read-only
boolean
|
$is_trace
Is this a |
public read-only
boolean
|
$is_local
Is this a local request? |
public read-only
boolean
|
$is_xhr
Is this an Ajax request? |
public read-only
string
|
$method
Method of the request. |
public read-only
string
|
$normalized_path
Path of the request normalized using the \ICanBoogie\normalize_url_path() function. |
public read-only
string
|
$path
Path info of the request. |
public read-only
string
|
$extension
The extension of the path. |
public read-only
integer
|
$port
Port of the request. |
public read-only
string
|
$query_string
Query string of the request. |
public read-only
string
|
$script_name
Name of the entered script. |
public read-only
string
|
$referer
Referer of the request. |
public read-only
string
|
$user_agent
User agent of the request. |
public read-only
string
|
$uri
URI of the request. The |