You are here

public function HttpClientRequest::getHeaders in Http Client 6.2

Same name and namespace in other branches
  1. 7.2 includes/HttpClient.inc \HttpClientRequest::getHeaders()

Returns the headers as a array. Multiple valued headers will have their values concatenated and separated by a comma as per http://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.2

Return value

array

File

includes/HttpClient.inc, line 581

Class

HttpClientRequest
This is a convenience class that allows the manipulation of a http request before it's handed over to curl.

Code

public function getHeaders() {
  $headers = array();
  foreach ($this->headers as $name => $values) {
    $headers[] = $name . ': ' . join($values, ', ');
  }
  return $headers;
}