lib/Elastica/Client.php
public function addHeader($header, $headerValue)
    {
        if (\is_string($header) && \is_string($headerValue)) {
            $this->_config['headers'][$header] = $headerValue;
        } else {
            throw new InvalidException('Header must be a string');
        }

        return $this;
    }
public function addHeader($header, $headerValue)
    {
        if (\is_string($header) && \is_string($headerValue)) {
            $this->_config['headers'][$header] = $headerValue;
        } else {
            throw new InvalidException('Header must be a string');
        }

        return $this;
    }
public function addHeader ( $ header , $ headerValue ) { if ( \ is_string ( $ header ) && \ is_string ( $ headerValue ) ) { $ this -> _config [ 'headers' ] [ $ header ] = $ headerValue ; } else { throw new InvalidException ( 'Header must be a string' ) ; } return $ this ; }
Adds a HTTP Header.

@param string $header      The HTTP Header
@param string $headerValue The HTTP Header Value

@throws \Elastica\Exception\InvalidException If $header or $headerValue is not a string

@return $this
Adds a HTTP Header .