public function setRequestHeader($name, $value)
    {
        if (!is_string($name))
            throw new \InvalidArgumentException('Argument 1 expected to be string, '.gettype($name).' seen.');

        if (!is_string($value))
            throw new \InvalidArgumentException('Argument 2 expected to be string, '.gettype($value).' seen.');

        if (($name = trim($name)) === '')
            throw new \RuntimeException('Argument 1 cannot be empty string.');

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

        return $this;
    }
public function setRequestHeader($name, $value)
    {
        if (!is_string($name))
            throw new \InvalidArgumentException('Argument 1 expected to be string, '.gettype($name).' seen.');

        if (!is_string($value))
            throw new \InvalidArgumentException('Argument 2 expected to be string, '.gettype($value).' seen.');

        if (($name = trim($name)) === '')
            throw new \RuntimeException('Argument 1 cannot be empty string.');

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

        return $this;
    }
public function setRequestHeader ( $ name , $ value ) { if ( ! is_string ( $ name ) ) throw new \ InvalidArgumentException ( 'Argument 1 expected to be string, ' . gettype ( $ name ) . ' seen.' ) ; if ( ! is_string ( $ value ) ) throw new \ InvalidArgumentException ( 'Argument 2 expected to be string, ' . gettype ( $ value ) . ' seen.' ) ; if ( ( $ name = trim ( $ name ) ) === '' ) throw new \ RuntimeException ( 'Argument 1 cannot be empty string.' ) ; $ this -> requestHeaders [ $ name ] = $ value ; return $ this ; }
Add a header string to the request

@param string $name
@param string $value
@throws \RuntimeException
@throws \InvalidArgumentException
@return $this
Add a header string to the request