@param string $header
@param        $value

@return Response
@throws \LogicException
492488
public function addHeader(string $header, $value): self
    {
        $this->header->set($header, $value, false);

        return $this;
    }
1103137
public function header($name, $value = null)
    {
        if (!is_null($value)) {
            $this->headers->set($name, $value);
        }

        return $this->headers->get($name);
    }
379082
public function withHeader($name, $value)
    {
        $request = clone $this;
        $request->headers->set($name, $value);

        return $request;
    }
503820
public function offsetSet($offset, $value) {
		$thing = $this->get($offset);
		if (!$thing->isFile() && $thing->isDirectory()) {
			throw  new LogicException("Cannot write to directory.");
		}
		/**
		 * @var File $thing
		 */

		if ($thing->isFile()) {
			$thing->write($value);
		} else {
			$this->createFile($offset, $value);
		}
	}
544002
private static function sendHeader($key, $value) {
    if (isset(self::$send_header)) {
      call_user_func(self::$send_header, $key, $value);
    } else {
      header(sprintf("%s: %s", $key, $value));
    }
  }
410901
public function header($name, $value = null)
    {
        if (!is_null($value)) {
            $this[$name] = $value;
        }

        return $this[$name];
    }
1245864
public function withHeader($name, $value)
    {
        if (array_key_exists($name, $this->headers) && in_array($value, $this->headers[$name])) {
            return $this;
        }

        $instance = clone $this;
        $instance->headers[$name] = array_filter((array)$value);
        return $instance;
    }
570389
public function withHeader($header, $value)
    {
        if ($this->complete) {
            return $this;
        }

        $new = $this->psrResponse->withHeader($header, $value);
        return new self($new);
    }
1046756
public function header($header, $value = null)
    {
        if (is_array($header)) {
            $this->option['header'] = $header;
        } else {
            $this->option['header'][$header] = $value;
        }

        return $this;
    }
900588
public function prepend($headers, $value = '')
    {
        if (is_string($headers) && func_num_args() === 2) {
            $headers = [$headers => $value];
        }
        return $this->_set($headers, true);
    }
506432
public function iShouldSeeInTheHeader($header, $value) {
    $headers = $this->getSession()->getResponseHeaders();
    if ($headers[$header] != $value) {
      throw new \Exception(sprintf("Did not see %s with value %s.", $header, $value));
    }
  }
728508
public function addHeader(string $name, string $value): Response
    {
        $this->headers->add($name, $value);
        return $this;
    }
309626
public function withAddedHeader($header, $value)
    {
        $new = $this->psrRequest->withAddedHeader($header, $value);
        return new self($new, $this->originalRequest);
    }
1210265
public function addHttpHeader($http_header, $value)
    {
        $field = EnumRequestOption::HTTP_HEADERS;
        $http_headers = isset($this->options[$field]) ? $this->options[$field] : [];

        foreach($http_headers as $key => $header){
            if (strpos($header, $http_header) === 0){
                $http_headers[$key] = "$http_header: $value\r\n";
                return;
            }
        }

        $http_headers[$http_header] = $value;
        $this->options[$field] = $http_headers;
    }
918133
protected function assertHeaderValue($value)
    {
        if (!is_string($value) && (!is_array($value) || array_product(array_map('is_string', $value)) === 0)) {
            throw new \InvalidArgumentException("Header value should be a string or an array of strings");
        }
    }
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;
    }
113741
public function setHeader(string $header, $value)
    {
        if (!is_scalar($value))
            throw new \InvalidArgumentException("Value should be a scalar");

        $header = static::normalizeHeader($header);
        $this->headers[$header] = $value;
        return $this;
    }