Adds a default header.

@param string $key the header's key
@param string $value the header's value
@return ApiClient
186476
public function addDefaultHeader($key, $value) {
		if (!is_string($key)) {
			throw new \InvalidArgumentException('The header key must be a string.');
		}

		$defaultHeaders[$key] = $value;
		return $this;
	}
492488
public function addHeader(string $header, $value): self
    {
        $this->header->set($header, $value, false);

        return $this;
    }
220400
public function add(string $name, $value): self
    {
        $this->headers[$name] = $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];
	}
1299950
protected function withHeader($name, $value)
    {
        $this->headers[ strtolower($name) ] = is_array($value)
            ? $value
            : [ $value ];

        return $this;
    }
845902
public function setHeader($key, $value)
    {
        if (!$this->controller->canEnd()) {
            return;
        }
        $this->response->header($key, $value);
        return $this;
    }
78035
public function header( string $name, string $value )
      : Request
   {

      if ( \is_null( $value ) || ! \is_string( $value ) )
      {
         unset( $this->_defaultHeaders[ $name ] );
      }

      $this->_defaultHeaders[ $name ] = $value;

      return $this;

   }
1271178
public function addHeader($name, $value)
    {
        $name = strtolower($name);
        $this->headers[$name] = $value;
        return $this;
    }
1001932
public function withHeader(string $key, $value): Headers
    {
        return new Headers(array_merge($this->headers, $this->filter([$key => $value])));
    }
544002
private static function sendHeader($key, $value) {
    if (isset(self::$send_header)) {
      call_user_func(self::$send_header, $key, $value);
    } else {
      header(sprintf("%s: %s", $key, $value));
    }
  }
86220
public function addHeader(string $name, string $value) : self
    {
        $name = $this->normalizeHeader($name);
        if (isset($this->headers[$name])) {
            throw new \InvalidArgumentException(
                sprintf("Header %s is already set with value '%s'", $name, $this->headers[$name])
            );
        }

        $this->headers[$name] = $value;

        return $this;
    }
528327
public void addHeader(String key, String value) {
    this.headers = addToMap(key, value, this.headers);
  }
393888
public function setDefault($key, $value)
    {
        foreach ($this->routes as $route)
            $route->setDefault($key, $value);
        return $this;
    }
404742
public function setHeader( $key, $value )
	{
		if( !in_array( $key, $this->headers ) )
			throw new InvalidArgumentException( "Unsupported Header '".$key."'" );
		$children	=& $this->tree->getChildren();
		$head		=& $children[0];
		$node		= new XML_DOM_Node( $key, $value );
		$head->addChild( $node );
	}
588740
public function setHeaders($key, $value = null)
    {
        if (is_array($key)) {
            $this->headers = $key;
            return $this;
        }

        $this->headers[] = $key.': '.$value;
        return $this;
    }
570389
public function withHeader($header, $value)
    {
        if ($this->complete) {
            return $this;
        }

        $new = $this->psrResponse->withHeader($header, $value);
        return new self($new);
    }
1223075
public function setHeaders($key, $value = null)
    {
        Argument::i()
            //argument 1 must be a string or array
            ->test(1, 'array', 'string')
            //argument 2 must be scalar or null
            ->test(2, 'scalar', 'null');

        if (is_array($key)) {
            $this->headers = $key;
            return $this;
        }

        $this->headers[] = $key.': '.$value;
        return $this;
    }