Get the the raw message headers as a string

@return string
513398
public function getRawHeaders()
    {
        $headers = 'HTTP/1.1 ' . $this->statusCode . ' ' . $this->reasonPhrase . "\r\n";
        $lines = $this->getHeaderLines();
        if (!empty($lines)) {
            $headers .= implode("\r\n", $lines) . "\r\n";
        }

        return $headers . "\r\n";
    }
549151
public function getHeader() : string
    {
        $salt = $this->getEncodedSalt();
        $hmac = $this->getEncodedHMAC();

        if ($this->version === 2) {
            $data = \base64_encode(\json_encode([
                'access_token' => $this->token->accessToken,
                'date' => $this->date,
                'hmac' => $hmac,
                'salt' => $salt,
                'v' => 2
            ]));

            return "HMAC {$data}";
        }

        // The version 1 HMAC is returned by default
        return "HMAC {$this->token->accessToken},{$hmac},{$salt}";
    }
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;
  }
669137
private function formatMessage() {

		$message = [];
		$files 	 = true === isset($this -> headers['files']) ? $this -> headers['files'] : [];

		if(count($files) > 0) {
			
			$message[] = sprintf("--Boundary-mixed-%s\r\n", $this -> getBoundary());
			$message[] = sprintf("Content-Type: multipart/alternative; boundary=\"Boundary-alt-%s\"\r\n\r\n", $this -> getBoundary());
		}

		if(true === isset($this -> message['text'])) {

			$message[] = sprintf("--Boundary-alt-%s\r\n", $this -> getBoundary());
			$message[] = "Content-Type: text/plain; charset=\"iso-8859-1\"\r\n";
			$message[] = "Content-Transfer-Encoding: 7bit\r\n\r\n";
			$message[] = sprintf("%s\r\n\r\n", $this -> message['text']);
		}

		if(true === isset($this -> message['html'])) {

			$message[] = sprintf("--Boundary-alt-%s\r\n", $this -> getBoundary());
			$message[] = "Content-Type: text/html; charset=\"iso-8859-1\"\r\n";
			$message[] = "Content-Transfer-Encoding: 7bit\r\n\r\n";
			$message[] = sprintf("%s\r\n\r\n", $this -> message['html']);
		}

		$message[] = sprintf("--Boundary-alt-%s--\r\n\r\n", $this -> getBoundary());

		if(count($files) > 0) {
			
			foreach($files as $attachment) {

				$stream 	= fopen($attachment -> file -> entity() -> getBasepath(), 'rb');
				$data 		= fread($stream, $attachment -> file -> getFilesize());
				$data 		= chunk_split(base64_encode($data));

				$message[] = sprintf("--Boundary-mixed-%s\r\n", $this -> getBoundary());
				$message[] = sprintf("Content-Type: %s; name=\"%s\"\r\n", $attachment -> mime, $attachment -> name);
				$message[] = "Content-Transfer-Encoding: base64\r\n";
				$message[] = "Content-Disposition: attachment \r\n\r\n";
				$message[] = sprintf("%s\r\n", $data);
			}

			$message[] = sprintf("--Boundary-mixed-%s--\r\n", $this -> getBoundary());
		}

		return implode('', $message);
	}
1302168
public function toString()
    {
        if (empty($this->stringRepresentation)) {
            $this->stringRepresentation = sprintf('%s%s_%s', static::MESSAGE_TO_STRING_PREFIX, $this->getSourceId(), $this->getResourceId());
        }
        return $this->stringRepresentation;
    }
584613
public function parseRawHeaders(array $rawHeaders)
    {
        $headers = array();
        $key = '';
        foreach ($rawHeaders as $rawHeader) {
            $rawHeaderLineParts = explode(':', $rawHeader, 2);
            if (isset($rawHeaderLineParts[1])) {
                $key = $rawHeaderLineParts[0];
                $value = trim($rawHeaderLineParts[1]);
                if (!isset($headers[$key])) {
                    $headers[$key] = $value;
                } elseif (is_array($headers[$key])) {
                    $headers[$key][] = $value;
                } else {
                    $headers[$key] = array($headers[$key], $value);
                }
            } elseif (strlen($rawHeaderLineParts[0]) > 0) {
                if (!$key) {
                    $headers[0] = trim($rawHeaderLineParts[0]);
                } elseif (in_array(substr($rawHeaderLineParts[0], 0, 1), array(' ', "\t"))) {
                    if (is_array($headers[$key])) {
                        $lastValue = array_pop($headers[$key]);
                        $headers[$key][] = $lastValue . "\r\n" . rtrim($rawHeaderLineParts[0]);
                    } else {
                        $headers[$key] .= "\r\n" . rtrim($rawHeaderLineParts[0]);
                    }
                }
            }
        }
        return $headers;
    }
957354
public function getHeader()
	{
		$header = [];

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

		return $header;
	}
771231
public function getMessage()
    {
        $message = $this->getRawHeaders();

        // Only include the body in the message if the size is < 2MB
        $size = $this->body->getSize();
        if ($size < 2097152) {
            $message .= (string) $this->body;
        }

        return $message;
    }
447769
public function toString()
    {
        $response = Parser\ResponseParser::buildStatusLine($this) . Http::NEW_LINE;
        $headers  = Parser\ResponseParser::buildHeaderFromMessage($this);

        foreach ($headers as $header) {
            $response.= $header . Http::NEW_LINE;
        }

        $response.= Http::NEW_LINE;
        $response.= (string) $this->getBody();

        return $response;
    }
1041260
public function getHeaderText(): string
    {
        $header      = $this->getHeaderElement();
        $header_text = $header->getText();
        $header_link = $header->find('css', 'a');

        // The page headers can often include an 'add new link'. Strip that out of the header text.
        if ($header_link) {
            $header_text = trim(str_replace($header_link->getText(), '', $header_text));
        }

        return $header_text;
    }
1047284
private function getHeaders(array $headers)
    {
        $str = '';
        foreach ($headers as $key => $value) {
            $str .= sprintf("%s: %s\r\n", $key, $value);
        }

        return $str;
    }
637238
public function toString() {
        $str = $this->protocol . '://' . $this->hostName;
        if ($this->protocol==='http' && $this->portNumber==80) {
            //don't add port
        } else if ($this->protocol==='https' && $this->portNumber==443) {
            //don't add port
        } else {
            $str .= ':'. $this->portNumber;
        }
        return $str;
    }
1206721
private function getRawHeaders(array $headers)
    {
        $rawHeaders = '';
        foreach ($headers as $key => $value) {
            $rawHeaders .= sprintf("%s: %s\n", $key, is_array($value) ? implode(', ', $value) : $value);
        }
        $rawHeaders .= "\n";

        return $rawHeaders;
    }
57662
public function toString()
    {
        $string = '';
        $headers = $this->headers;
        if ($this->canSort()) {
            uksort($headers, [$this, 'sortHeaders']);
        }
        foreach ($headers as $collection) {
            foreach ($collection as $header) {
                if ($this->isDisplayed($header) || '' != $header->getFieldBody()) {
                    $string .= $header->toString();
                }
            }
        }

        return $string;
    }
419775
public function getHttpHeaders()
    {
        if ($this->headers === null) {
            $this->headers = new SimpleHeaders();
            $this->headers->setContentType('text/csv', $this->options['charset']);
            //$this->headers->setContentDispositionType(SimpleHeaders::DIPOSITION_ATTACHEMENT);
        }

        return $this->headers;
    }
147520
public function toString()
    {
        $request = sprintf('%s %s HTTP/%s', $this->getMethod(), (string) $this->getUrl(), $this->getVersion());

        $str = trim($request) . "\r\n";
        $str .= $this->getHeaders();
        $str .= "\r\n";
        $str .= $this->getContent();
        return $str;
    }
731701
public function dumpString(): string
    {
        if ($this->header === null) {
            $this->header = new PoHeader;
            $this->header->buildDefaultHeader();
        }
        $output = '';

        $output .= $this->header->dumpEntry();
        foreach ($this->entries as $entry) {
            $output .= $entry->dumpEntry();
        }
        foreach ($this->unkeyedEntries as $entry) {
            $output .= $entry->dumpEntry();
        }
        $output .= "\n";

        return $output;
    }