NOTE: For Version 3 of the AWS SDK for PHP, please see the V3 User Guide and V3 API Reference.

# Class HeaderCollection

Provides a case-insensitive collection of headers

  Guzzle\Http\Message\Header\HeaderCollection implements IteratorAggregate, Countable, ArrayAccess, Guzzle\Common\ToArrayInterface

Namespace: Guzzle\Http\Message\Header
Located at Guzzle/Http/Message/Header/HeaderCollection.php

## Methods summary

- `public` `__construct ( mixed $headers = array() )`
- `public` `__clone ( )`
- `public` `clear ( )`

  Clears the header collection

- `public` `add ( Guzzle\Http\Message\Header\HeaderInterface $header )`

  Set a header on the collection

- `public` `getAll ( )`

  Get an array of header objects

- `public` `get ( mixed $key )`

  Alias of offsetGet

- `public` `count ( )`
- `public` `offsetExists ( mixed $offset )`
- `public` `offsetGet ( mixed $offset )`
- `public` `offsetSet ( mixed $offset, mixed $value )`
- `public` `offsetUnset ( mixed $offset )`
- `public` `getIterator ( )`
- `public` `toArray ( )`

  Get the array representation of an object

## Methods detail

# `public`
`__construct( mixed $headers = array() )`
# `public`
`__clone( )`
# `public`
`clear( )`

Clears the header collection

# `public `Guzzle\Http\Message\Header\HeaderCollection``
`add( `Guzzle\Http\Message\Header\HeaderInterface` $header )`

Set a header on the collection

#### Parameters

$header
  ``Guzzle\Http\Message\Header\HeaderInterface``
  $header Header to add

#### Returns

``Guzzle\Http\Message\Header\HeaderCollection``
# `public array`
`getAll( )`

Get an array of header objects

#### Returns

`array`
# `public`
`get( mixed $key )`

Alias of offsetGet

# `public`
`count( )`

#### Implementation of

`Countable::count()`
# `public`
`offsetExists( mixed $offset )`

#### Implementation of

`ArrayAccess::offsetExists()`
# `public`
`offsetGet( mixed $offset )`

#### Implementation of

`ArrayAccess::offsetGet()`
# `public`
`offsetSet( mixed $offset, mixed $value )`

#### Implementation of

`ArrayAccess::offsetSet()`
# `public`
`offsetUnset( mixed $offset )`

#### Implementation of

`ArrayAccess::offsetUnset()`
# `public`
`getIterator( )`

#### Implementation of

`IteratorAggregate::getIterator()`
# `public array`
`toArray( )`

Get the array representation of an object

#### Returns

`array`

#### Implementation of

`Guzzle\Common\ToArrayInterface::toArray()`

### Magic methods summary

## Properties summary

`protected array` | $headers | #