Constructs a new header and returns it.

@param string|null $name The name of the header.
@param string|null $value The value of the header.
@return \BearFramework\App\Response\Header Returns a new header.
184617
public function make(string $name = null, string $value = null): \BearFramework\App\Response\Header
    {
        if ($this->newHeaderCache === null) {
            $this->newHeaderCache = new \BearFramework\App\Response\Header();
        }
        $object = clone($this->newHeaderCache);
        if ($name !== null) {
            $object->name = $name;
        }
        if ($value !== null) {
            $object->value = $value;
        }
        return $object;
    }
1217330
public function header($name, $value = null)
    {

        if ($value === null) {
            $this->headers[] = $name;
        } else {
            $this->headers[] = $this->headerString($name, $value);
        }

        return $this;
    }
367379
public function withHeader(string $name, $value): Builder
    {
        $this->headers[$name] = $value;

        return $this;
    }
726904
public function setHeader($name, $value)
    {
        $this->response = $this->response->withHeader($name, $value);
        return $this;
    }
410901
public function header($name, $value = null)
    {
        if (!is_null($value)) {
            $this[$name] = $value;
        }

        return $this[$name];
    }
220400
public function add(string $name, $value): self
    {
        $this->headers[$name] = $value;
        return $this;
    }
308798
public function setDefaultHeader(string $name, string $value) {
        $this->defaultHeaders[$name] = $value;
        return $this;
    }
330340
final public function withAddedHeader($name, $value): self
    {
        return $this->withHeader($name, array_merge($this->getHeader($name), (array)$value));
    }
693499
protected function addHeaderValue(string $name, $value)
    {
        if (!is_scalar($value)) {
            throw new IllegalHeaderValueException($value);
        }

        if (!array_key_exists($name, $this->headersContainer)) {
            $this->headersContainer[$name] = [];
        }

        $this->headersContainer[$name][] = $value;

        return $this;
    }
365585
public function setHeader($name, $value)
    {
        $context = $this->_context;

        $context->headers[$name] = $value;

        return $this;
    }
681839
protected function _sendHeader($name, $value = null)
    {
        deprecationWarning(
            'Will be removed in 4.0.0'
        );

        if ($value === null) {
            header($name);
        } else {
            header("{$name}: {$value}");
        }
    }
277013
public function header($name, $value)
        {
            $this->foundation->headers->set($name, $value);
            return $this;
        }
40249
public function headerLine($name, $value)
    {
        if (stripos($name, 'X-') !== false) {
            return null;
        }

        return parent::headerLine($name, $value);
    }
1001517
public function withHeader($name, $value) : self
    {
        $new = clone $this;

        return $new->setResponse($this->response->withHeader($name, $value));
    }
628290
public final function withHeader($name, $value): MessageInterface
   {
       $value = $this->parseHeaderValue($value);
       if (!is_string($name) || [] === $value) {
           throw new InvalidArgumentException(
               "Can't get instance for header: invalid " . $name);
       }
       $header = $this->header;
       $header[$this->parseHeaderName($name)] = $value;
       return $this->with("header", $header);
   }
1114994
public static function build($name, $value = '')
    {
        Types::assert(['string' => [$name, $value]]);

        $namespace = __NAMESPACE__.'\\Headers';

        foreach (self::$memberClasses as $class => $headerNames)
        {
            $class = "$namespace\\$class";

            if (in_array(strtolower($name), $headerNames, true))
            {
                return new $class($name, $value);
            }
        }

        return new RegularHeader($name, $value);
    }
396651
public static Header of(String name, String value) {
        return new Header(requireNonNull(name), requireNonNull(value));
    }