Overview

Namespaces

  • Contrib
    • Bundle
      • CoverallsBundle
        • Console
        • Entity
      • CoverallsV1Bundle
        • Api
        • Collector
        • Command
        • Config
        • Entity
          • Git
    • Component
      • File
      • Log
      • System
        • Git
  • Guzzle
    • Batch
      • Exception
    • Cache
    • Common
      • Exception
    • Http
      • Curl
      • Exception
      • Message
      • QueryAggregator
    • Inflection
    • Iterator
    • Log
    • Parser
      • Cookie
      • Message
      • UriTemplate
      • Url
    • Plugin
      • Async
      • Backoff
      • Cache
      • Cookie
        • CookieJar
        • Exception
      • CurlAuth
      • ErrorResponse
        • Exception
      • History
      • Log
      • Md5
      • Mock
      • Oauth
    • Service
      • Builder
      • Command
        • Factory
        • LocationVisitor
          • Request
          • Response
      • Description
      • Exception
      • Resource
    • Stream
  • PHP
  • Psr
    • Log
  • Symfony
    • Component
      • Config
        • Definition
          • Builder
          • Exception
        • Exception
        • Loader
        • Resource
        • Util
      • Console
        • Command
        • Formatter
        • Helper
        • Input
        • Output
        • Tester
      • EventDispatcher
        • Debug
      • Finder
        • Adapter
        • Comparator
        • Exception
        • Expression
        • Iterator
        • Shell
      • Stopwatch
      • Yaml
        • Exception

Classes

  • AbstractMessage
  • EntityEnclosingRequest
  • Header
  • HeaderComparison
  • PostFile
  • Request
  • RequestFactory
  • Response

Interfaces

  • EntityEnclosingRequestInterface
  • MessageInterface
  • PostFileInterface
  • RequestFactoryInterface
  • RequestInterface
  • Overview
  • Namespace
  • Class
  • Tree
  • Todo

Class Header

Represents a header and all of the values stored by that header

Guzzle\Http\Message\Header implements Guzzle\Common\ToArrayInterface, IteratorAggregate, Countable
Namespace: Guzzle\Http\Message
Located at Guzzle/Http/Message/Header.php
Methods summary
public
# __construct( string $header, array $values = array(), string $glue = ', ' )

Construct a new header object

Construct a new header object

Parameters

$header
string
$header Name of the header
$values
array
$values Values of the header
$glue
string
$glue Glue used to combine multiple values into a string
public string
# __toString( )

Convert the header to a string

Convert the header to a string

Returns

string
public Guzzle\Http\Message\Header
# add( string $value, string $header = null )

Add a value to the list of header values

Add a value to the list of header values

Parameters

$value
string
$value Value to add
$header
string
$header The exact header casing to add with. Defaults to the name of the header.

Returns

Guzzle\Http\Message\Header
public string
# getName( )

Get the name of the header

Get the name of the header

Returns

string
public Guzzle\Http\Message\Header
# setGlue( string $glue )

Change the glue used to implode the values

Change the glue used to implode the values

Parameters

$glue
string
$glue Glue used to implode multiple values

Returns

Guzzle\Http\Message\Header
public string
# getGlue( )

Get the glue used to implode multiple values into a string

Get the glue used to implode multiple values into a string

Returns

string
public Guzzle\Http\Message\Header
# normalize( boolean $explodeOnGlue = false )

Normalize the header to be a single header with an array of values

Normalize the header to be a single header with an array of values

Parameters

$explodeOnGlue
boolean
$explodeOnGlue Set to true to explode each header value on the glue of the header

Returns

Guzzle\Http\Message\Header
public boolean
# hasExactHeader( string $header )

Check if a particular case variation is present in the header Example: A header exists on a message for 'Foo', and 'foo'. The Header object will contain all of the values of 'Foo' and all of the values of 'foo'. You can use this method to check to see if a header was set using 'foo' (true), 'Foo' (true), 'FOO' (false), etc.

Check if a particular case variation is present in the header Example: A header exists on a message for 'Foo', and 'foo'. The Header object will contain all of the values of 'Foo' and all of the values of 'foo'. You can use this method to check to see if a header was set using 'foo' (true), 'Foo' (true), 'FOO' (false), etc.

Parameters

$header
string
$header Exact header to check for

Returns

boolean
public boolean
# hasValue( string $searchValue, boolean $caseInsensitive = false )

Check if the collection of headers has a particular value

Check if the collection of headers has a particular value

Parameters

$searchValue
string
$searchValue Value to search for
$caseInsensitive
boolean
$caseInsensitive Set to TRUE to use a case insensitive search

Returns

boolean
public Guzzle\Http\Message\Header
# removeValue( string $searchValue )

Remove a specific value from the header

Remove a specific value from the header

Parameters

$searchValue
string
$searchValue Value to remove

Returns

Guzzle\Http\Message\Header
public array
# toArray( )

Get all of the header values as a flat array Get the array representation of an object

Get all of the header values as a flat array Get the array representation of an object

Returns

array

Implementation of

Guzzle\Common\ToArrayInterface::toArray()
public array
# raw( )

Get the raw data array of the headers. This array is represented as an associative array of the various cases that might be stored in the header and an array of values associated with each case variation.

Get the raw data array of the headers. This array is represented as an associative array of the various cases that might be stored in the header and an array of values associated with each case variation.

Returns

array
public integer
# count( )

Returns the total number of header values

Returns the total number of header values

Returns

integer

Implementation of

Countable::count()
public ArrayIterator
# getIterator( )

Get an iterator that can be used to easily iterate over each header value

Get an iterator that can be used to easily iterate over each header value

Returns

ArrayIterator

Implementation of

IteratorAggregate::getIterator()
Properties summary
protected array $values array()
#
protected mixed $header
#
protected mixed $glue
#
protected mixed $stringCache
#
protected mixed $arrayCache
#
php-coveralls API documentation generated by ApiGen 2.8.0