You are here

public function HttpClientRequest::setHeader in Http Client 6.2

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

Sets a header value.

Parameters

string $name:

string $value:

Return value

void

File

includes/HttpClient.inc, line 614

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 setHeader($name, $value) {
  if (!is_array($value)) {
    $this->headers[$name][] = $value;
  }
  else {
    $this->headers[$name] = $value;
  }
}