Sends body for the current web response.

@return $this
966521
public function sendBody(Response $response)
    {
        $body = $response->getBody();
        $body->rewind();
        echo $body->getContents();
        return $response;
    }
491840
public function setBody(Body $body)
    {
        $this->body = $body;
        $this->setAllHeaders($body->getHeaders());
        $this->setStatus($body->getStatusCode());

        return $this;
    }
599670
public function sendHeaders()
     {
         $response = $this->getResponse();
         $headers = $response->getHeaders();
         $isAjax = $response->getRequest()->isAjax();

         if (isset($headers['Location']) && $response->isSuccess() && !$isAjax) {
             $response->setStatus(AnHttpResponse::SEE_OTHER);
         }

         return parent::sendHeaders();
     }
1134743
public function sendHeaderResponse()
    {
        if ($this->response != false) {
            $this->response->sendHeaders();

            return $this->response->getWpStatusCodeHeader();
        }
    }
404475
public function sendHeaders()
    {
        // headers have already been sent by the developer
        if (headers_sent()) {
            return $this;
        }

        // headers
        foreach ($this->headers->allPreserveCaseWithoutCookies() as $name => $values) {
            $replace = 0 === strcasecmp($name, 'Content-Type');
            foreach ($values as $value) {
                header($name.': '.$value, $replace, $this->statusCode);
            }
        }

        // cookies
        foreach ($this->headers->getCookies() as $cookie) {
            header('Set-Cookie: '.$cookie->getName().strstr($cookie, '='), false, $this->statusCode);
        }

        // status
        header(sprintf('HTTP/%s %s %s', $this->version, $this->statusCode, $this->statusText), true, $this->statusCode);

        return $this;
    }
570872
public function getBody()
    {
        if ($this->stream === null) {
            ob_start();
            $this->htmlElement->toHtml();
            $content = ob_get_clean();
            $this->stream = new Stream('php://memory', 'wb+');
            $this->stream->write($content);
        }

        return $this->stream;
    }
5815
public function send()
    {
        $responses = new \StdClass();

        foreach ($this->resources as $key => $promise) {
            $response = $promise->wait();
            $responses->{$key} = $this->parse($response->getBody());
        }

        return $responses;
    }
1209579
public function send(): HttpResponse {
        $ch = $this->createCurl();
        $response = $this->execCurl($ch);
        curl_close($ch);

        return $response;
    }
1183215
public function sendHeaders()
    {
        // headers have already been sent by the developer
        if (headers_sent()) {
            return $this;
        }

        /* RFC2616 - 14.18 says all Responses need to have a Date */
        if (!$this->headers->has('Date')) {
            $this->setDate(\DateTime::createFromFormat('U', time()));
        }

        // headers
        foreach ($this->headers->allPreserveCaseWithoutCookies() as $name => $values) {
            foreach ($values as $value) {
                header($name.': '.$value, false, $this->statusCode);
            }
        }

        // status
        header(sprintf('HTTP/%s %s %s', $this->version, $this->statusCode, $this->statusText), true, $this->statusCode);

        // cookies
        foreach ($this->headers->getCookies() as $cookie) {
            if ($cookie->isRaw()) {
                setrawcookie($cookie->getName(), $cookie->getValue(), $cookie->getExpiresTime(), $cookie->getPath(), $cookie->getDomain(), $cookie->isSecure(), $cookie->isHttpOnly());
            } else {
                setcookie($cookie->getName(), $cookie->getValue(), $cookie->getExpiresTime(), $cookie->getPath(), $cookie->getDomain(), $cookie->isSecure(), $cookie->isHttpOnly());
            }
        }

        return $this;
    }
1287220
final public function web()
    {
        $request = Request::createFromGlobals();
        $response = $this->handle($request);
        $response->send();
        $this->terminate($request, $response);
    }
442329
function sendContent()
    {
        if ($this->isContentSent())
            return $this;

        $body = $this->getMessageObject()->getBody();
        ob_start();
        if ($body instanceof iStreamable) {
            while (! $body->isEOF() )
                echo $r = $body->read(24400);
            ob_end_flush();
            flush();
            ob_start();
        } else {
            echo $body;
        }
        ob_end_flush();
        flush();
        
        $this->isContentSent = true;
        return $this;
    }
1190167
public function send()
	{
		if( $this->method === 'POST' )
			$this->addHeaderPair( 'Content-Length', mb_strlen( $this->data ) );
		if( !$this->headers->getFieldsByName( 'connection' ) )
			$this->addHeaderPair( 'Connection', 'close' );

		$result	= "";
		$fp = fsockopen( $this->host, $this->port, $errno, $errstr, 2 );
		if( !$fp )
			throw new RuntimeException( $errstr.' ('.$errno.')' );

		$uri	= $this->uri/*.( $this->port ? ':'.$this->port : "" )*/;
		$lines	= array(
			$this->method." ".$uri." HTTP/".$this->version,
			$this->headers->render(),
		);
		if( $this->method === 'POST' )
			$lines[]	= $this->data;
		$lines	= join( "\r\n", $lines );
		fwrite( $fp, $lines );																		//  send Request
		while( !feof( $fp ) )																		//  receive Response
			$result .= fgets( $fp, 1024 );															//  collect Response chunks
		fclose( $fp );																				//  close Connection
		$response	= Net_HTTP_Response_Parser::fromString( $result );
		if( count( $response->getHeader( 'Location' ) ) ){
			$location	= array_shift( $response->getHeader( 'Location' ) );
			$this->host	= parse_url( $location->getValue(), PHP_URL_HOST );
			$this->setPort( parse_url( $location->getValue(), PHP_URL_PORT ) );
			$this->setUri( parse_url( $location->getValue(), PHP_URL_PATH ) );
			return $this->send();
		}
		return $response;
	}
66826
public function setBody($body)
    {
        $this->body = $body;
        $this->setHeader('Content-Length', strlen($body));

        return $this;
    }
232740
public function sendResponse()
    {
        $xml =& CKFinder_Connector_Core_Factory::getInstance("Core_Xml");
        $this->_connectorNode =& $xml->getConnectorNode();

        $this->checkConnector();
        if ($this->mustCheckRequest()) {
            $this->checkRequest();
        }

        $resourceTypeName = $this->_currentFolder->getResourceTypeName();
        if (!empty($resourceTypeName)) {
            $this->_connectorNode->addAttribute("resourceType", $this->_currentFolder->getResourceTypeName());
        }

        if ($this->mustAddCurrentFolderNode()) {
            $_currentFolder = new Ckfinder_Connector_Utils_XmlNode("CurrentFolder");
            $this->_connectorNode->addChild($_currentFolder);
            $_currentFolder->addAttribute("path", CKFinder_Connector_Utils_FileSystem::convertToConnectorEncoding($this->_currentFolder->getClientPath()));

            $this->_errorHandler->setCatchAllErros(true);
            $_url = $this->_currentFolder->getUrl();
            $_currentFolder->addAttribute("url", is_null($_url) ? "" : CKFinder_Connector_Utils_FileSystem::convertToConnectorEncoding($_url));
            $this->_errorHandler->setCatchAllErros(false);

            $_currentFolder->addAttribute("acl", $this->_currentFolder->getAclMask());
        }

        $this->buildXml();

        $_oErrorNode =& $xml->getErrorNode();
        $_oErrorNode->addAttribute("number", "0");

        echo $this->_connectorNode->asXML();
        exit;
    }
558010
public function send()
    {
        if ($this->sent === false) {
            $this->sendHeaders();
            $this->sendCookies();

            $content = (string)$this->getBody();
            if (!empty($content)) {
                echo $content;
            } else {
                if (is_string($this->file)) {
                    if (!file_exists($this->file)) {
                        throw new Exception('The requested file was not found');
                    }
                    $handle = fopen($this->file, 'r');

                    if ($handle !== false) {
                        fpassthru($handle);
                        fclose($handle);
                    }
                }
            }

            $this->sent = true;

            return $this;
        }

        throw new Exception('Response was already sent');
    }
779531
public function send()
    {
        if ($this->sent()) {
            throw new Exceptions\HeadersAlreadySentException(
                "Headers already sent"
            );
        }

        $this->sent = true;

        foreach ($this as $header) {
            $header->send();
        }

        return $this;
    }
365763
public function send()
    {
        $this->sendCookies();

        $this->sendHeaders();

        if ($this->request->server('REQUEST_METHOD') === 'HEAD') {
            return '';
        }

        echo $this->body;
    }