public function setHeader($key, $value = null, $toLower = true)
    {
        if (is_array($key)) {
            foreach ($key as $k => $v) {
                $this->setHeader($k, $v);
            }
        } else {
            if ($toLower === true) {
                $key = strtolower($key);
            }
            if ($value === null) {
                unset($this->_headers[$key]);
            } else {
                $this->_headers[$key] = $value;
            }
        }
    }
public function setHeader($key, $value = null, $toLower = true)
    {
        if (is_array($key)) {
            foreach ($key as $k => $v) {
                $this->setHeader($k, $v);
            }
        } else {
            if ($toLower === true) {
                $key = strtolower($key);
            }
            if ($value === null) {
                unset($this->_headers[$key]);
            } else {
                $this->_headers[$key] = $value;
            }
        }
    }
public function setHeader ( $ key , $ value = null , $ toLower = true ) { if ( is_array ( $ key ) ) { foreach ( $ key as $ k => $ v ) { $ this -> setHeader ( $ k , $ v ) ; } } else { if ( $ toLower === true ) { $ key = strtolower ( $ key ) ; } if ( $ value === null ) { unset ( $ this -> _headers [ $ key ] ) ; } else { $ this -> _headers [ $ key ] = $ value ; } } }
Set http header or headers
@param mixed $key string key or key-value pairs to set multiple headers.
@param string $value the header value when key is string, set null to remove header.
@param boolean $toLower convert key to lowercase
Set http header or headers