Adds a custom header. $name value can be overloaded to contain
both header name and value (name:value)
@access public
@param string $name custom header name
@param string $value header value
@return void
488912
public function AddCustomHeader($name, $value=null) {
	if ($value === null) {
		// Value passed in as name:value
		$this->CustomHeader[] = explode(':', $name, 2);
	} else {
		$this->CustomHeader[] = array($name, $value);
	}
  }
1344070
final public function withHeader($name, $value): self
    {
        $message = clone $this;

        //Make sure to remove the current header with the same
        //name to avoid casing-duplication (location, Location, LOCATION)
        if ($message->hasHeader($name)) {
            $message = $message->withoutHeader($name);
        }

        $message->addHeaders([$name => $value]);
        return $message;
    }
1297871
public function addHeader(string $name, $value)
    {
        $lName = strtolower($name);
        if (isset($this->headers[$lName])) {
            $this->headers[$lName][1] = array_merge(
                $this->headers[$lName][1],
                (array) $value
            );
        } else {
            $this->headers[$lName] = [
                $name,
                (array) $value,
            ];
        }
    }
960657
public function addHeader($name, $value = null) {
        if ($this->canSetHeaders()) {
            if ($value === null) {
                $value = trim(substr($name, strpos($name, ':') + 1));
                $name = trim(substr($name, 0, strpos($name, ':')));
            }

            $this->headers[$name] = $value;
        }
    }
1282481
protected function addHeader(string $name, $value): Headers
    {
        if (!is_scalar($value) && !is_array($value)) {
            throw new IllegalHeaderValueException($value);
        }

        if (is_scalar($value)) {
            $this->addHeaderValue($name, $value);

            return $this;
        }

        foreach ($value as $item) {
            $this->addHeaderValue($name, $item);
        }

        return $this;
    }
490744
final public function withHeader(string $name, string $value) : HttpException
    {
        $this->headers[$name] = $value;

        return $this;
    }
375419
public function addHeader(string $header, string $value): self
    {
        $this->headers[$header] = $value;

        return $this;
    }
1171383
public void addHeader(String name, String value) {
        if (name == null || name.trim().length() == 0) {
            throw new IllegalArgumentException("The header name must not be null or empty.");
        }

        if (value == null) {
            throw new IllegalArgumentException("The header value must not be null.");
        }

        this.headers.put(name, value);
    }
308798
public function setDefaultHeader(string $name, string $value) {
        $this->defaultHeaders[$name] = $value;
        return $this;
    }
28594
public function addHeader(string $name, string $value): bool
    {

        /* Initialize the return value */
        $isSet = false;

        /* If the given parameters aren't empty */
        if (!empty($name) && !empty($value)) {

            /* Assign the values */
            $this->offsetSet($name, $value);
            $isSet = true;
        }

        return $isSet;
    }
390254
public function setHeader(string $name, string $value): void
    {
        parent::setHeader($name, $value);
    }
373497
public function setRequestHeader($name, $value) {
    $header = array();
    $header[$name] = $value;
    //TODO: as a limitation of the driver it self, we will send permanent for the moment
    $this->browser->addHeader($header, true);
  }
1006360
public function addHeader($name, $value, $params = null)
    {
        if (is_array($params)) {
            $this->message->getHeaders()->addParameterizedHeader($name, $value, $params);
        } else {
            $this->message->getHeaders()->addTextHeader($name, $value);
        }

        return $this;
    }
401413
public function addHeader($header, $value)
    {
        $name = strtolower($header);

        if(is_array($value))
        {
            foreach($value as $v)
                $this->headers[$name][] = trim($v);

            foreach(array_keys($this->headerLines) as $key)
                if(strtolower($key) == $name)
                    unset($this->headerLines[$key]);

            $this->headerLines[$header] = $this->headers[$name];
        }
        else
        {
            $this->headers[$name][] = trim($value);

            foreach(array_keys($this->headerLines) as $key)
                if(strtolower($key) == $name)
                    unset($this->headerLines[$key]);

            $this->headerLines[$header] = $this->headers[$name];
        }

        return $this;
    }
1103137
public function header($name, $value = null)
    {
        if (!is_null($value)) {
            $this->headers->set($name, $value);
        }

        return $this->headers->get($name);
    }
865785
public final function header(string $name, string $value = null)
    {
        return ($value === null) ? $this->getHeader($name) : $this->setHeader($name, $value);
    }
416858
public function addHeader(string $name, string $value): void
    {
        parent::addHeader($name, $value);
    }