Requests 2.0.14 API

CaseInsensitiveDictionary
in package
implements ArrayAccess, IteratorAggregate

Case-insensitive dictionary, suitable for HTTP headers

Table of Contents

Interfaces

ArrayAccess
IteratorAggregate

Properties

$data  : array<string|int, mixed>
Actual item data

Methods

__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

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
Attributes
#[ReturnTypeWillChange]
Return values
ArrayIterator

offsetExists()

Check if the given item exists

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

Item key

Attributes
#[ReturnTypeWillChange]
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

Attributes
#[ReturnTypeWillChange]
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)

Attributes
#[ReturnTypeWillChange]

offsetUnset()

Unset the given header

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

The key for the item to unset.

Attributes
#[ReturnTypeWillChange]

        
On this page

Search results