Add a request header

@param string $key
@param string $value
2253
public function addRequestHeader($key, $value = null)
    {
        if (is_array($key)) {
            foreach ($key as $newKey => $newValue) {
                $this->addRequestHeader($newKey, $newValue);
            }
        } else {
            $key = preg_replace_callback(
                '/([\s\-_]|^)([a-z0-9-_])/',
                function ($match) {
                    return strtoupper($match[0]);
                },
                $key
            );
            $this->requestHeader[] = "$key: $value";
        }
    }
947293
final public static function setHeader($key, $value)
	{
		if (function_exists('header')) {
			static::_cleanHeader($key);
			if (is_array($value) or (is_object($value) and $value = get_object_vars($value))) {
				$value = join('; ', array_map(
					[__CLASS__, '_encodeHeader'],
					array_keys($value),
					array_values($value)
				));
			}
			header("$key: $value");
		}
	}
1037124
public function setRequestHeader($header, $value) {
        $this->request = $this->request->withHeader($header, $value);

        return $this;
    }
721178
public function header( $key, $value = null ) {

		$key = explode( '-', $key );
		foreach( $key as $k => $v ) {
			$key[$k] = ucfirst( strtolower($v));
		}
		$key = implode( '-', $key );

		if ( !is_null( $value ) ) {
			$this->_headers[$key] = $value;
		}

		return $this->_headers[$key];
	}
436433
public function addHeader($key, $value)
    {
        $this->options[GuzzleRequestOptions::HEADERS][$key] = $value;

        return $this;
    }
433647
protected function setHeader($key, $value)
    {
        if (SERVER_MODE === 'swoole') {
            $GLOBALS['__$response']->header($key, $value);
        } else {
            if (!headers_sent()) {
                header($key . ': '. $value);
            }
        }
    }
1035048
public function setHeader($key, $value, $http_response_code = null)
    {
        header($key.': '.$value, null, $http_response_code);
    }
1105629
public function header($key, $value = null)
	{
		if( is_null($value) )
		{
			$pos = strpos($key, ":");
			if( ! $pos )
			{
				return $this;
			}

			$value = substr($key, $pos + 1);
			$key = substr($key, 0, $pos);
		}
		$this->headers->set($key, $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;
    }
300344
public void setHeader(String key, Object value) {
        this.httpMessage.headers().set(key, value);
    }
728508
public function addHeader(string $name, string $value): Response
    {
        $this->headers->add($name, $value);
        return $this;
    }
1267486
public function addHeader ($header, $value = null)
		{
			if ($value)
				$this->_headers[] = "$header: $value";
			else
				$this->_headers[] = $header;

			return $this;
		}
1189952
public function addHeader(string $name, string $value = null)
    {
        if (!is_null($value)) {
            return $this->set('headers', $name, $value);
        }

        return $this->set('headers', $name, null);
    }
335191
public void addHeader(String key, String value) {
        if (key.equals("As-User")) {
            for (int i = 0; i < this.headers.size(); i++) {
                if (this.headers.get(i).getKey().equals("As-User")) {
                    this.headers.remove(i);
                }
            }
        }
        if (key.equals("X-Box-UA")) {
            throw new IllegalArgumentException("Altering the X-Box-UA header is not permitted");
        }
        this.headers.add(new RequestHeader(key, value));
    }
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,
            ];
        }
    }
11631
public function withHeader(string $key, string $value): void
    {
        $this->headers[$key] = $value;
    }
784945
@Override
    public void addHeader(String key, String value)
    {
        _conn.setRequestProperty(key, value);
    }