public function AbstractMessage::getHeader

Retrieve an HTTP header by name. Performs a case-insensitive search of all headers.

Parameters

string $header Header to retrieve.:

bool $string Set to true to get the header as a string:

Return value

string|Header|null Returns NULL if no matching header is found. Returns a string if $string is set to TRUE. Returns a Header object if a matching header is found.

Overrides MessageInterface::getHeader

34 calls to AbstractMessage::getHeader()
AbstractMessage::getTokenizedHeader in drupal/core/vendor/guzzle/http/Guzzle/Http/Message/AbstractMessage.php
Get a tokenized header as a Collection
Request::changedHeader in drupal/core/vendor/guzzle/http/Guzzle/Http/Message/Request.php
Check to see if the modified headers need to reset any of the managed headers like cache-control
Request::getCookies in drupal/core/vendor/guzzle/http/Guzzle/Http/Message/Request.php
Get an array of Cookies
Request::removeCookie in drupal/core/vendor/guzzle/http/Guzzle/Http/Message/Request.php
Remove a specific cookie value by name
Response::getAcceptRanges in drupal/core/vendor/guzzle/http/Guzzle/Http/Message/Response.php
Get the Accept-Ranges HTTP header

... See full list

File

drupal/core/vendor/guzzle/http/Guzzle/Http/Message/AbstractMessage.php, line 72

Class

AbstractMessage
Abstract HTTP request/response message

Namespace

Guzzle\Http\Message

Code

public function getHeader($header, $string = false) {
  $key = strtolower($header);
  if (!isset($this->headers[$key])) {
    return null;
  }
  return $string ? (string) $this->headers[$key] : $this->headers[$key];
}