{@see Psr\Http\Message\StreamInterface::withHeader()}
323187
public function withHeader($header, $value)
    {
        // Normalize the header names.
        $header = trim($header);
        $name   = strtolower($header);

        // Create a clone and set the given header in the clone.
        $new = clone $this;

        $new->headerNames[$name] = $header;
        $new->headers[$header]   = (array) $value;

        return $new;
    }
193774
public function withHeaders( array $headers )
	{
		foreach ( $headers as $key => $value )
		{
			$this->headers->set( $key, $value );
		}

		return $this;
	}
308446
public function sendHeaders()
    {
        if (!headers_sent()) {
            foreach ($this->headers as $header) {
                header($header, true);
            }
        }

        $this->headers = array();
        return $this;
    }
490744
final public function withHeader(string $name, string $value) : HttpException
    {
        $this->headers[$name] = $value;

        return $this;
    }
460531
public function add(HeaderInterface $header)
    {
        $this->headers[strtolower($header->getName())] = $header;

        return $this;
    }
956057
private function readHeader(): self
    {
        if (null !== $this->statusLine) {
            return $this;
        }

        do {
            $this->parseStatusLine($this->socket->readLine());
            $headers = '';
            $line    = '';
            while (!$this->socket->eof() && Http::END_OF_LINE !== $line) {
                $line     = $this->socket->readLine() . Http::END_OF_LINE;
                $headers .= $line;
            }

            $this->headers->append($headers);
        } while ($this->requireContinue());
        return $this;
    }
604312
public function load($fileName, $withHeader = true)
    {
        if ($this->files->exists($fileName) != true) {
            error('File %s not found', $fileName);
        }

        $this->fileName = $fileName;
        $this->cols = [];
        $this->items = [];

        // Carregar arquivo
        $hnd = fopen($this->fileName, 'r');
        while ($data = fgetcsv($hnd, $this->maxLength, $this->delimiter)) {
            // Primeira linha
            if ((count($this->items) == 0) && (count($this->cols) == 0)) {
                $this->cols = ($withHeader ? $data : array_keys($data));
                if ($withHeader != true) {
                    $this->items[] = $this->make_row($data);
                }
            } else { // Demais linhas
                $this->items[] = $this->make_row($data);
            }
        }
        fclose($hnd);
    }
157419
public function setHeader($header, $value = NULL)
	{
		if($header instanceof HttpHeaderInterface)
		{
			$this->headers[strtolower($header->getFieldName())] = [[(string)$header->getFieldName(), trim($header->getFieldValue())]];
		}
		else
		{
			$this->headers[strtolower($header)] = [[(string)$header, trim($value)]];
		}
		
		return $this;
	}
603306
public function withHeaders(array $headers): self
    {
        return tap($this, function ($request) use ($headers) {
            return $this->options = array_merge_recursive($this->options, [
                'headers' => $headers,
            ]);
        });
    }
952285
public function usingHeader(string $key, $value): self
    {
        $this->headers->put($key, $value);
        return $this;
    }
884655
protected function sendHeaders()
    {
        if (headers_sent($file, $line)) {
            throw new HeadersAlreadySentException($file, $line);
        }
        if ($this->_headerCollection) {
            foreach ($this->getHeaders() as $name => $values) {
                $name = str_replace(' ', '-', ucwords(str_replace('-', ' ', $name)));
                // set replace for first occurrence of header but false afterwards to allow multiple
                $replace = true;
                foreach ($values as $value) {
                    header("$name: $value", $replace);
                    $replace = false;
                }
            }
        }
        $statusCode = $this->getStatusCode();
        $protocolVersion = $this->getProtocolVersion();
        header("HTTP/{$protocolVersion} {$statusCode} {$this->reasonPhrase}");
        $this->sendCookies();
    }
241533
public function setHeader($headers = [])
    {
        $this->headers = $headers;
        $this->debug->info(__FUNCTION__, 'setHeaders: ', $this->headers);

        return $this;
    }
731660
final public function withoutHeader($name): self
    {
        if (!$this->hasHeader($name)) {
            return clone $this;
        }

        $lowerName = strtolower($name);
        $name = $this->headerNames[$lowerName];

        $message = clone $this;
        unset($message->headers[$name], $message->headerNames[$lowerName]);
        return $message;
    }
91022
public function sendHeaders()
	{
		// Early return if headers already have been send
		if (headers_sent()) {
			return $this;
		}

		foreach ($this->headers as $key => $value) {
			header(
				sprintf('%s: %s', $key, is_array($value) ? implode('; ', $value) : $value),
				true,
				$this->statusCode
			);
		}

		header(sprintf('%s %s %s',
			self::$protocolVersionMap[$this->protocolVersion],
			$this->statusCode,
			self::$statusCodeMap[$this->statusCode]
		));

		return $this;
	}
1037124
public function setRequestHeader($header, $value) {
        $this->request = $this->request->withHeader($header, $value);

        return $this;
    }
835559
public function removeHeader(string $name) : Message
    {
        $name = strtolower($name);
        unset($this->headers[$name]);

        return $this;
    }
881325
public function setHeader()
    {
        $args = func_get_args();

        if (is_array($args[0])) {
            foreach ($args[0] as $key => $value)
                $this->headers['headers'][$key] = $value;
        } else {
            $this->headers['headers'][$args[0]] = $args[1];
        }

        return $this;
    }