public function send()
    {
        // Send headers
        if (headers_sent() === false) {
            if (strpos(PHP_SAPI, 'cgi') === 0) {
                header(sprintf('Status: %s', $this->getReasonPhrase()));
            } else {
                header(sprintf('%s %s', $this->getProtocolVersion(), $this->getReasonPhrase()));
            }

            foreach ($this->headers as $name => $value) {
                foreach ($value as $hVal) {
                    header("$name: $hVal", false);
                }
            }
        }

        // Send body
        $this->body->seek(0);
        while ($this->body->feof() === false) {
            echo $this->body->read(1024);
        }

        return $this;
    }
public function send()
    {
        // Send headers
        if (headers_sent() === false) {
            if (strpos(PHP_SAPI, 'cgi') === 0) {
                header(sprintf('Status: %s', $this->getReasonPhrase()));
            } else {
                header(sprintf('%s %s', $this->getProtocolVersion(), $this->getReasonPhrase()));
            }

            foreach ($this->headers as $name => $value) {
                foreach ($value as $hVal) {
                    header("$name: $hVal", false);
                }
            }
        }

        // Send body
        $this->body->seek(0);
        while ($this->body->feof() === false) {
            echo $this->body->read(1024);
        }

        return $this;
    }
public function send ( ) { // Send headers if ( headers_sent ( ) === false ) { if ( strpos ( PHP_SAPI , 'cgi' ) === 0 ) { header ( sprintf ( 'Status: %s' , $ this -> getReasonPhrase ( ) ) ) ; } else { header ( sprintf ( '%s %s' , $ this -> getProtocolVersion ( ) , $ this -> getReasonPhrase ( ) ) ) ; } foreach ( $ this -> headers as $ name => $ value ) { foreach ( $ value as $ hVal ) { header ( "$name: $hVal" , false ) ; } } } // Send body $ this -> body -> seek ( 0 ) ; while ( $ this -> body -> feof ( ) === false ) { echo $ this -> body -> read ( 1024 ) ; } return $ this ; }
Send HTTP response headers and body

@return \Slim\Interfaces\Http\Response Self
@api
Send HTTP response headers and body