gear/Network/Response.php
/**
     * Sends HTTP headers.
     *
     * @return object Self reference
     */
Sends HTTP headers.
@return object Self reference
Sends HTTP headers . @return object Self reference
public function sendHeaders()
    {
        if (isset($_SERVER['SERVER_PROTOCOL'])) {
            $header = $_SERVER['SERVER_PROTOCOL'];
        } else {
            $header = 'HTTP/1.1';
        }
        $header .= ' ' . $this->status . ' ' . self::$codes[$this->status];
        header($header, true, $this->status);
        header('Content-type: '.$this->contentType);
        foreach ($this->headers as $field => $value) {
            if (is_array($value)) {
                foreach ($value as $v) {
                    header($field.': '.$v, false);
                }
            } else {
                header($field.': '.$value);
            }
        }
        if (($length = strlen($this->body)) > 0) {
            header('Content-Length: '.$length);
        }
        return $this;
    }
public function sendHeaders ( ) { if ( isset ( $ _SERVER [ 'SERVER_PROTOCOL' ] ) ) { $ header = $ _SERVER [ 'SERVER_PROTOCOL' ] ; } else { $ header = 'HTTP/1.1' ; } $ header .= ' ' . $ this -> status . ' ' . self :: $ codes [ $ this -> status ] ; header ( $ header , true , $ this -> status ) ; header ( 'Content-type: ' . $ this -> contentType ) ; foreach ( $ this -> headers as $ field => $ value ) { if ( is_array ( $ value ) ) { foreach ( $ value as $ v ) { header ( $ field . ': ' . $ v , false ) ; } } else { header ( $ field . ': ' . $ value ) ; } } if ( ( $ length = strlen ( $ this -> body ) ) > 0 ) { header ( 'Content-Length: ' . $ length ) ; } return $ this ; }
Sends HTTP headers.
Sends HTTP headers .
// Send other headers // Send content length