Send headers.
@return void
495424
public function sendHeaders(): void
    {
        foreach ((array) $this->headers as $name => $value) {
            $this->sendHeader($name, $value);
        }
    }
248443
public function sendHeaders()
	{
		// headers have already been sent by the developer
		if (headers_sent()) {
			return $this;
		}

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

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

		return $this;
	}
314632
public function sendHeaders()
    {
        foreach ($this->getHeaders() as $name => $values) {
            foreach ($values as $value) {
                header(sprintf('%s: %s', $name, $value), false);
            }
        }

        return $this;
    }
519578
protected function send_headers() {
        if ($this->restformat == 'json') {
            header('Content-type: application/json');
        } else {
            header('Content-Type: application/xml; charset=utf-8');
            header('Content-Disposition: inline; filename="response.xml"');
        }
        header('Cache-Control: private, must-revalidate, pre-check=0, post-check=0, max-age=0');
        header('Expires: '. gmdate('D, d M Y H:i:s', 0) .' GMT');
        header('Pragma: no-cache');
        header('Accept-Ranges: none');
        // Allow cross-origin requests only for Web Services.
        // This allow to receive requests done by Web Workers or webapps in different domains.
        header('Access-Control-Allow-Origin: *');
    }
986499
public function sendHeaders()
    {
        // cookie
        foreach($this->cookies as $cookie)
        {
            $this->swooleResponse->cookie($cookie['key'], $cookie['value'], $cookie['expire'] ?? 0, $cookie['path'] ?? '/', $cookie['domain'] ?? '', $cookie['secure'] ?? false, $cookie['httponly'] ?? false);
        }
        // header
        foreach($this->getHeaders() as $name => $headers)
        {
            $this->swooleResponse->header($name, $this->getHeaderLine($name));
        }
        // status
        $this->swooleResponse->status($this->getStatusCode());
        return $this;
    }
929450
public function sendHeaders()
    {
        // first build headers -> only if they haven't already been sent
        if (!headers_sent()) {
            // status code header
            header(self::PROTOCOL . ' ' . $this->getStatusCode() . ' ' . $this->statusMessage
            );

            // other headers
            foreach ($this->headers as $k => $v) {
                header($k . ': ' . $v);
            }

            // cache control headers
            $cacheControlHeaders = $this->cacheControl->getCacheControl();
            foreach ($cacheControlHeaders as $k => $v) {
                header($k . ': ' . $v);
            }
        }

        return $this;
    }
416524
public function send()
    {
        header($this->getStatusStr());

        foreach($this->headers as $header => $value) {
            header(sprintf("%s: %s", $header, implode(',', $value)));
        }

        $body = $this->getBody();

        if ($body->isAttached()) {
            $body->rewind();
            while (!$body->eof()) {
                echo $body->read($this->bodySize);
            }
        }
    }
832292
public function send()
    {

        if (headers_sent()) {
            throw new HttpException(Response::STATUS_INTERNAL_SERVER_ERROR, 'Headers already send');
        }

        header($this->getStatusLine());

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

        echo $this->body;
    }
1267866
public function sendHeaders()
    {
        if (headers_sent() === true) {
            return;
        }
        foreach ($this->renderHeaders() as $header) {
            header($header, false);
        }
        foreach ($this->headers->getCookies() as $cookie) {
            header('Set-Cookie: ' . $cookie, false);
        }
    }
1070186
public function send(): void
    {
        $body = $this->getBody();

        $this->sendCookies();

        switch (true) {
            case 'CLI' === $this->type:
                // no CLI response
                return;
            case null === $body:
            case StatusCode::NO_CONTENT === $this->getStatusCode():
                $response = new EmptyResponse($this->getStatusCode(), $this->getHeaders());
                break;
            case StatusCode::MOVED_PERMANENTLY === $this->getStatusCode():
            case StatusCode::FOUND === $this->getStatusCode():
                $response = new RedirectResponse(
                    $this->getHeader('Location'),
                    $this->getStatusCode(),
                    $this->getHeaders()
                );
                break;
            case 'JSON' === $this->type:
                // JSON response
                // setup messages
                if (Messages::count()) {
                    $this->setHeader('Bluz-Notify', json_encode(Messages::popAll()));
                }

                // encode body data to JSON
                $response = new JsonResponse(
                    $body,
                    $this->getStatusCode(),
                    $this->getHeaders()
                );
                break;
            case 'FILE' === $this->type:
                // File attachment
                $response = new AttachmentResponse(
                    $this->body->getData()->get('FILE'),
                    $this->getStatusCode(),
                    $this->getHeaders()
                );
                break;
            case 'HTML' === $this->type:
            default:
                // HTML response
                $response = new HtmlResponse(
                    (string)$body,
                    $this->getStatusCode(),
                    $this->getHeaders()
                );
                break;
        }

        $emitter = new SapiEmitter();
        $emitter->emit($response);
    }
241210
public function sendHeaders()
    {
        // Throw exception if header already sent
        if ($this->headersSent()) {
            throw new ResponseException('Cannot send headers, headers already sent.');
        }

        /*
         | If headers not set already we will set header here
         */
        if (!$this->headers->has('Content-Type')) {
            $this->setHeader('Content-Type', $this->getContentType().'; charset='.$this->getCharset());
        }

        // Check if script is running in FCGI server
        if ($this->server('FCGI_SERVER_VERSION')) {
            //We will set Header for Fast-CGI server
            $this->setFastCgiHeader();
        } else {
            $this->setHeaderForServer();
        }

        foreach ($this->headers->all() as $name => $values) {
            foreach ($values as $value) {
                // Create the header and send it
                is_string($name) && $value = "{$name}: {$value}";
                header($value, true);
            }
        }

        return $this;
    }
674172
public function sendHeaders()
    {
        foreach ($this->_headers as $key => $value) {
            if (is_array($value)) {
                foreach ($value as $v) {
                    header($key.': '.$v, false);
                }
            } else {
                header($key.': '.$value);
            }
        }

        return $this;
    }
1241922
public static function sendHeaders()
    {
        if (! headers_sent()) {
            foreach (self::$headers as $header) {
                header($header, true);
            }

            return true;
        }

        return false;
    }
1321174
public function sendHeaders()
    {
        if (!headers_sent()) {
            header(
                sprintf(
                    'HTTP/%s %s %s',
                    $this->getProtocolVersion(),
                    $this->getStatusCode(),
                    ($this->isOk() ? '' : $this->getReasonPhrase())
                ),
                true,
                $this->getStatusCode()
            );

            foreach ($this->header as $name => $value) {
                $name = str_replace(' ', '-', ucwords(str_replace('-', ' ', $name)));
                header(sprintf('%s: %s', $name, implode(',', $value)), false, $this->statusCode);
            }

            foreach ($this->cookie as $cookie) {
                header(sprintf('Set-Cookie: %s', $cookie->asString()), false, $this->getStatusCode());
            }
        }
    }
76482
private function sendHeaders()
    {
        foreach ($this->body->getHeaders() as $key => $value) {
            $key = join('-', array_map('ucfirst', explode('-', $key)));
            header(sprintf('%s: %s', $key, $value));
        }
    }
365763
public function send()
    {
        $this->sendCookies();

        $this->sendHeaders();

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

        echo $this->body;
    }
414435
public function send()
    {
        $data = $this->parseDataToString($this->data);
        $format = $this->allowedFormats[$this->format];

        // Send status header
        header($this->getStatus(), true, $this->getStatus());

        foreach(self::$headers as $key => $value) {
            header($key.": ".$value);
        }

        // Send content type header
        header("Content-Type: ".$format['mimetype']."; charset=utf-8");

		// Set content length header
		header("Content-Length: ".strlen($data));

        if(function_exists("ginger_log")) {
            ginger_log($this);
        }

        echo $data;

        die();
    }