Class MOXMAN_Http_Request

InheritanceMOXMAN_Http_Request

This class wrapps in the HTTP Request and adds various useful options.

Public Methods

Hide inherited methods

MethodDescriptionDefined By
__construct() Constructs a new HTTP Request instance. MOXMAN_Http_Request
get() Returns the specified item stripped from slashes. MOXMAN_Http_Request
getAll() Returns a name/value array with all items merged. MOXMAN_Http_Request
getFile() Returns a single file object by name or null. MOXMAN_Http_Request
getFiles() Returns an array of file items that got uploaded. MOXMAN_Http_Request
getHeader() Returns a specific header by name. MOXMAN_Http_Request
getMethod() Returns the current HTTP method as an uppercase string. MOXMAN_Http_Request
getUrl() Returns the currently requested page as an URL name/value array. MOXMAN_Http_Request
has() Returns true/false if the request has the specified item name or not. MOXMAN_Http_Request

Property Details

$getParams protected property
protected array $getParams null
$headers protected property
protected array $headers null
$postParams protected property
protected array $postParams null
$url protected property
protected array $url null

Method Details

__construct() public method

Constructs a new HTTP Request instance.

public void __construct ( )
get() public method

Returns the specified item stripped from slashes.

public String get ( $name, $default "" )
$name string

Name of the item to retrive.

$default string

Default value to return if the specified item wasn't found.

return String

Value of the specified string or an empty string if it wasn't found.

getAll() public method

Returns a name/value array with all items merged.

public Array getAll ( )
return Array

Name/value array with get and post merged.

getFile() public method

Returns a single file object by name or null.

public array getFile ( $name )
$name string

Name of multipart file upload form field.

return array

File array object or null.

getFiles() public method

Returns an array of file items that got uploaded.

public Array getFiles ( )
return Array

Array with the files that got uploaded.

getHeader() public method

Returns a specific header by name.

public String getHeader ( $name, $defaultValue null )
$name String

Name of header to get.

$defaultValue String

Optional default value if the header isn't defined.

return String

Current header value or default value if it wasn't found.

getMethod() public method

Returns the current HTTP method as an uppercase string.

public String getMethod ( )
return String

Upper case HTTP Method like GET, POST etc.

getUrl() public method

Returns the currently requested page as an URL name/value array.

public Array getUrl ( )
return Array

Name/value array with URL details.

has() public method

Returns true/false if the request has the specified item name or not.

public Boolean has ( $name )
$name string

Name if the item to check for.

return Boolean

True/false if the item exists or not.