Case-insensitive dictionary, suitable for HTTP headers

package Requests
inherited_from \Requests_Utility_CaseInsensitiveDictionary

 Methods

Creates a case insensitive dictionary.

__construct(array $data = array()
Inherited

Parameters

$data

array

Dictionary/map to convert to case-insensitive

Flattens a value into a string

flatten(string|array $value) : string

Converts an array into a string by imploding values with a comma, as per RFC2616's rules for folding headers.

Parameters

$value

stringarray

Value to flatten

Returns

stringFlattened value

Get the headers as an array

getAll() : array
Inherited

Returns

arrayHeader data

Get an iterator for the data

getIterator() : \ArrayIterator

Converts the internal

inherited_from \Requests_Utility_CaseInsensitiveDictionary::getIterator()

Returns

\ArrayIterator

Get an iterator for the data

getIterator() : \ArrayIterator
Inherited

Returns

\ArrayIterator

Get all values for a given header

getValues(string $key) : array

Parameters

$key

string

Returns

arrayHeader values

Check if the given item exists

offsetExists(string $key) : boolean
Inherited

Parameters

$key

string

Item key

Returns

booleanDoes the item exist?

Get the given header

offsetGet(string $key) : string

Unlike \self::getValues(), this returns a string. If there are multiple values, it concatenates them with a comma as per RFC2616.

Avoid using this where commas may be used unquoted in values, such as Set-Cookie headers.

inherited_from \Requests_Utility_CaseInsensitiveDictionary::offsetGet()

Parameters

$key

string

Returns

stringHeader value

Get the value for the item

offsetGet(string $key) : string
Inherited

Parameters

$key

string

Item key

Returns

stringItem value

Set the given item

offsetSet(string $key, string $value) 
inherited_from \Requests_Utility_CaseInsensitiveDictionary::offsetSet()

Parameters

$key

string

Item name

$value

string

Item value

Exceptions

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

Set the given item

offsetSet(string $key, string $value) 
Inherited

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) 
Inherited

Parameters

$key

string

 Properties

 

Actual item data

$data : array

Default

array()