public function setHeaders($key, $value = null)
    {
        if (is_array($key)) {
            foreach ($key as $a_key => $value) {
                $this->headers[strtolower($a_key)] = "$a_key: $value";
            }
        } elseif (empty($value)) {
            $this->headers[] = $key;
        } else {
            $this->headers[strtolower($key)] = "$key: $value";
        }

        return $this;
    }
public function setHeaders($key, $value = null)
    {
        if (is_array($key)) {
            foreach ($key as $a_key => $value) {
                $this->headers[strtolower($a_key)] = "$a_key: $value";
            }
        } elseif (empty($value)) {
            $this->headers[] = $key;
        } else {
            $this->headers[strtolower($key)] = "$key: $value";
        }

        return $this;
    }
public function setHeaders ( $ key , $ value = null ) { if ( is_array ( $ key ) ) { foreach ( $ key as $ a_key => $ value ) { $ this -> headers [ strtolower ( $ a_key ) ] = "$a_key: $value" ; } } elseif ( empty ( $ value ) ) { $ this -> headers [ ] = $ key ; } else { $ this -> headers [ strtolower ( $ key ) ] = "$key: $value" ; } return $ this ; }
Add value to header. Same header values will be replaced.

@param string|array $key
@param mixed $value

@return $this
Add value to header . Same header values will be replaced .