Outputs the content of this response object. All headers will be sent in the order they were added.

@return string
511417
public function output()
    {
        $content = $this->getContent();

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

        return $content;
    }
630293
protected function outputUploadOutcome()
    {
        $json = new \stdClass();
        // errors
        if(!$this->uploadOk) {
            if($this->uploader->getMessages()) {
                $this->uploadMessages[] = implode('\n', $this->uploader->getMessages());
            }
            $json->error = implode('\n', $this->uploadMessages);
            $this->httpResponse = $this->httpResponse->withStatus('412', $json->error);
        } else {
            //input file informations
            $json->input = [
                'name' => $this->uploadFields[$this->uploadedField]->getInputFile(),
                'hash' => $this->uploadFields[$this->uploadedField]->getInputHash()
            ];
            // generated file(s) paths
            $json->outputs = $this->uploadFields[$this->uploadedField]->getOutputsFiles();
        }
        return json_encode($json);
    }
691773
public function output()
    {
        $this->updateHeaders();

        @ob_end_clean();
        if (ini_get('zlib.output_compression')) {
            ini_set('zlib.output_compression', 'Off');
        }

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

        set_time_limit(0);
        return $this->streamfile();
    }
323660
public function header()
    {
        /** @var string $tabHeader Header html view */
        $tabSubHeader = '';

        // Set content of header view
        $tabHeader = $this->renderer->view($this->headerContentView)
            ->headName(t($this->name, true))
            ->headUrl('#'.$this->id)
            ->set($this->size, 'subTabsCount')
            ->output();

        // If tab has sub tabs
        if (count($this->subTabs) > 1) {
            // Render header of each sub tab inside parent tab
            foreach ($this->subTabs as $tab) {
                $tabSubHeader .= $tab->header();
            }
        }

        return $this->renderer->view($this->headerIndexView)
            ->tabHeader($tabHeader)
            ->tabSubHeader($tabSubHeader)
            ->output();
    }
714844
public function getHeaderContent()
    {
        if (!$this->headerFileHandle) {
            return null;
        }

        fseek($this->headerFileHandle, 0);

        $lines = array();
        while ($line = trim(fgets($this->headerFileHandle), "\n\r")) {
            $lines[] = $line;
        }

        return $lines;
    }
957354
public function getHeader()
	{
		$header = [];

		foreach ($this->columns as $column) {
			$header[] = $this->translator->translate($column->getName());
		}

		return $header;
	}
668767
private function extractHeadersFromResponse() {
    $response = "";
    $code = $this->response->getStatusCode();
    $text = HttpUtil::getResponseTextForCode($code);
    $response .= sprintf(self::STATUS_LINE_FORMAT, $code, $text);

    foreach($this->response->getHeaderList() as $header) {
      $response .= sprintf("%s: %s%s",
                           $header->getKey(),
                           $header->getValue(),
                           self::CRLF);
    }
    $response .= self::CRLF;
    return $response;
  }
147685
protected function buildOutputObject()
    {
        $output = new \Slab\Controllers\Response(
            static::DEFAULT_REDIRECT_RESOLVER,
            $this->data,
            $this->redirectType,
            $this->displayHeaders
        );

        return $output;
    }
1335263
private function sendHead(): Response
    {
        $this->header($this->status->line($this->version, $this->sapi));
        foreach ($this->headers as $name => $value) {
            $this->header($name . ': ' . $value);
        }

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

        $this->header('Content-type: ' . $this->mimeType);
        if (!$this->headers->contain('X-Request-ID')) {
            $this->header('X-Request-ID: ' . $this->request->id());
        }

        return $this;
    }
325528
public String printResponseHeaders() {
		StringBuilder sb = new StringBuilder();
		HttpURLConnection http = http();
		if (http != null) {
			Map<String, List<String>> header = http.getHeaderFields();
			for (String key : header.keySet()) {
				for (String val : header.get(key)) {
					sb.append(key).append(": ").append(val).append("\n");
				}
			}
		}
		return sb.toString();
	}
93737
public function parseHeader()
    {
        //$header = explode("\r\n", rtrim($this->response['headerRaw'], "\r\n"));
        
        $rawHeaders = rtrim($this->response['headerRaw'], "\r\n");
        # Handle multiple responses e.g. with redirections (proxies too)
        $headerGroups = explode("\r\n\r\n", $rawHeaders);
        # We're only interested in the last one
        $header = explode("\r\n", end($headerGroups));

        $output = array();

        if ('HTTP' === substr($header[0], 0, 4)) {
            list($output['version'], $output['status']) = explode(' ', $header[0]);
            unset($header[0]);
        }

        foreach ($header as $entry) {
            $pos = strpos($entry, ':');
            $output[trim(substr($entry, 0, $pos))] = trim(substr($entry, $pos + 1));
        }

        $this->response['header'] = $output;
        return $this;
    }
652560
def header_output(self):
        '''
        '''
        result = []
        for key in self.keys():
            result.append(key + '=' + self.get(key).value)
        return '; '.join(result)
1329913
public function toArray()
    {
        $output = [];
        $output[] = sprintf(
            'HTTP/1.1 %s %s',
            $this->statusCode,
            self::codeToReason($this->statusCode)
        );
        foreach ($this->headers as $k => $v) {
            $output[] = sprintf('%s: %s', $k, $v);
        }
        $output[] = '';
        $output[] = $this->body;

        return $output;
    }
1223505
public function getContent()
    {
        if (empty($this->_content) && $this->_headers->has('Content-Length') && $this->_headers->get('Content-Length') > 0)
        {
            $data = '';

            $input = fopen('php://input', 'r');
            while ($chunk = fread($input, 1024)) {
                $data .= $chunk;
            }

            fclose($input);

            $this->_content = $data;
        }

        return $this->_content;
    }
55658
public function output()
    {
        if ($this->status === null) {
            $this->status = (empty($this->body) || $this->method === 'HEAD')
                ? HttpResponse::HTTP_NO_CONTENT
                : HttpResponse::HTTP_OK;
        }

        if ($this->method === 'HEAD'
            || !HttpResponse::canHaveBody($this->status)
        ) {
            $content_type = 'HEAD';
        } elseif (is_array($this->body)) {
            $content_type = 'application/json';
        } else {
            $content_type = $this->headers['Content-Type'] ?? null;
        }

        Utils::checkOutput($content_type);

        if ($this->zlib_compression && $content_type !== 'HEAD') {
            ini_set('zlib.output_compression', 1);
        }

        header(HttpResponse::getHeader($this->status));
        foreach ($this->headers as $key => $value) {
            header("$key: " . implode(',', (array) $value));
        }

        if ($content_type !== 'HEAD') {
            if (is_array($this->body)) {
                echo json_encode($this->body, JSON_PRETTY_PRINT);
            } else {
                echo $this->body;
            }
        }
    }
1260373
public function to_header() {/*{{{*/
    $out ='Authorization: OAuth realm=""';
    $total = array();
    foreach ($this->parameters as $k => $v) {
      if (substr($k, 0, 5) != "oauth") continue;
      if (is_array($v)) throw new OAuthException('Arrays not supported in headers');
      $out .= ',' . OAuthUtil::urlencode_rfc3986($k) . '="' . OAuthUtil::urlencode_rfc3986($v) . '"';
    }
    return $out;
  }
899398
public function getOutput() {
		// create stream handle for the output
		$handle = fopen('php://temp/maxmemory:'.(1*1024*1024), 'r+'); // 1MB

		if (is_null($this->callback)) $this->callback = $_REQUEST['callback'];

		fwrite($handle, $this->callback . '(');
		fwrite($handle, json_encode($this->_content['content']));
		fwrite($handle, ');');
		return $handle;
	}