Case-insensitive dictionary, suitable for HTTP headers

package Requests
subpackage Utilities

 Methods

Creates a case insensitive dictionary.

__construct(array $data = array()

Parameters

$data

array

Dictionary/map to convert to case-insensitive

Get the headers as an array

getAll() : array

Returns

arrayHeader data

Get an iterator for the data

getIterator() : \ArrayIterator

Returns

\ArrayIterator

Check if the given item exists

offsetExists(string $key) : boolean

Parameters

$key

string

Item key

Returns

booleanDoes the item exist?

Get the value for the item

offsetGet(string $key) : string

Parameters

$key

string

Item key

Returns

stringItem value

Set the given item

offsetSet(string $key, string $value) 

Parameters

$key

string

Item name

$value

string

Item value

Exceptions

\Requests_Exception On attempting to use dictionary as list (`invalidset`)

Unset the given header

offsetUnset(string $key) 

Parameters

$key

string

 Properties

 

Actual item data

$data : array

Default

array()