Set a request header
string $name Header name (e.g. 'Accept'):
string $value Header value or null:
public function setHeaders($name, $value = null) {
$normalizedName = strtolower($name);
// If $value is null or false, unset the header
if ($value === null || $value === false) {
unset($this->headers[$normalizedName]);
}
else {
// Else, set the header
$this->headers[$normalizedName] = array(
$name,
$value,
);
}
return $this;
}