Requests 2.0.0 API

CaseInsensitiveDictionary
in package
implements ArrayAccess, IteratorAggregate

Case-insensitive dictionary, suitable for HTTP headers

Interfaces, Classes and Traits

ArrayAccess
IteratorAggregate

Table of Contents

$data  : array<string|int, mixed>
Actual item data
__construct()  : mixed
Creates a case insensitive dictionary.
getAll()  : array<string|int, mixed>
Get the headers as an array
getIterator()  : ArrayIterator
Get an iterator for the data
offsetExists()  : bool
Check if the given item exists
offsetGet()  : string|null
Get the value for the item
offsetSet()  : mixed
Set the given item
offsetUnset()  : mixed
Unset the given header

Properties

Methods

__construct()

Creates a case insensitive dictionary.

public __construct([array<string|int, mixed> $data = [] ]) : mixed
Parameters
$data : array<string|int, mixed> = []

Dictionary/map to convert to case-insensitive

Return values
mixed

getAll()

Get the headers as an array

public getAll() : array<string|int, mixed>
Return values
array<string|int, mixed>

Header data

getIterator()

Get an iterator for the data

public getIterator() : ArrayIterator
Return values
ArrayIterator

offsetExists()

Check if the given item exists

public offsetExists(string $offset) : bool
Parameters
$offset : string

Item key

Return values
bool

Does the item exist?

offsetGet()

Get the value for the item

public offsetGet(string $offset) : string|null
Parameters
$offset : string

Item key

Return values
string|null

Item value (null if the item key doesn't exist)

offsetSet()

Set the given item

public offsetSet(string $offset, string $value) : mixed
Parameters
$offset : string

Item name

$value : string

Item value

Tags
throws
Exception

On attempting to use dictionary as list (invalidset)

Return values
mixed

offsetUnset()

Unset the given header

public offsetUnset(string $offset) : mixed
Parameters
$offset : string
Return values
mixed

Search results