Set accept  header

@var string $header The accept language header
354650
public function setAcceptHeader(string $header)
    {
        if (Validation::isValidAcceptType($header)) {
            $this->acceptHeader = $header;
        } else {
            throw new CustomException('Invalid accept type');
        }
    }
375419
public function addHeader(string $header, string $value): self
    {
        $this->headers[$header] = $value;

        return $this;
    }
166029
public function setHeader($header, $value)
    {
        if (is_array($value)) {
            throw new \Exception('Could not set the header: '.$header);
        }
        $this->headers[$header] = $value;
    }
1330929
public function set(string $name, string $value): void
    {
        $key = strtolower($name);
        $this->headers[$key] = [$name, $value];
    }
1030596
public Request acceptLanguage(String language){
        final String acceptLanguage = RequestHeaderFields.ACCEPT_LANGUAGE.getName();
        String languageValue = headers.get(acceptLanguage);
        if (languageValue == null){
            languageValue = language;
        } else {
            languageValue = languageValue + ", " + language;
        }
        return this.setHeader(acceptLanguage, languageValue);
    }
937063
protected function sendHeader(string $header, string $content): void
    {
        if (!headers_sent() && self::$sendHeaders) {
            header(sprintf('%s: %s', $header, $content));
        }
    }
649122
public function set(string $header, string $value) : void
    {
        $this->headers[$header] = $value;
    }
1300248
function setHeaders($headers){
		$this->debug("setHeaders headers=");
		$this->appendDebug($this->varDump($headers));
		$this->requestHeaders = $headers;
	}
1160833
public function isAcceptLanguage($language)
    {
        if ($this->hasHeader('Accept-Language')) {
            return $this->isAccept($this->getHeader('Accept-Language'), $language);
        }
        return false;
    }
959778
function send( $request )
    {
        if ( $this->Verb != '' )
        {
            $request->setMethod( $this->Verb );
        }
        // use strict comparison, so that setting it to '' by the end user will work
        if ( $this->NameVar !== null )
        {
            $request->setNameVar( $this->NameVar );
        }
        if ( $this->ResponseType !== null )
        {
            $request->setResponseType( $this->ResponseType );
        }
        if ( $this->RequestType !== null )
        {
            $request->setContentType( $this->RequestType );
        }
        if ( $this->Accept !== null )
        {
            $request->setAccept( $this->Accept );
        }
        if ( count( $this->RequestHeaders ) )
        {
            foreach( $this->RequestHeaders  as $name => $value )
            {
                $request->setExtraHeader( $name, $value );
            }
        }
        return parent::send( $request );
    }
1133299
public function setLanguage($language) {
        if (!session_id()) {
            if ($this->sessionManager) {
                $this->sessionManager->start();
            }
        }
		$_SESSION['_fine_I18n_language'] = $language;
	}
745317
private function setHeader($header)
    {
        preg_match("'\[(.*?)\] 'si", $header, $match);
        if (!isset($match[1])) {
            throw new Exception('Unable to read datetime from header.');
        }
        $this->setDatetime($match[1]);

        $header = $this->cleanHeader($header);

        if (preg_match('/^[a-z]+.[A-Z]+:/', $header, $out)) {
            $this->setEnv($out[0]);
            $header = trim(str_replace($out[0], '', $header));
        }

        $this->header = $header;

        return $this;
    }
1330499
function setHeaders($headers) {
      if (is_array($headers)) {
        reset($headers);
        while (list($name, $value) = each($headers)) {
          $this->requestHeaders[$name] = $value;
        }
      }
    }
407215
public function allowHeaders($headers = '*')
    {
        $headers = array_map([HeaderHelper::class, 'normalizeHeaderName'], (array) $headers);
        $headers = implode(', ', $headers);

        $this->response = $this->response->withHeader('Access-Control-Allow-Headers', $headers);

        return $this;
    }
834312
function set($key,$val) {
		$key=$this->fixheader($key);
		return $this->headers[$key]=$val;
	}
722105
function set(props, req, language) {
  if(language) {
    req.language = language;
  }
  else {
    language = req.language = acceptLanguage.get(req.headers['accept-language']);
  }

  if(typeof props.localizations === 'function') {
    req.localizations = props.localizations(language);
  }
}
288211
private function parseHeader($header)
    {
        $res = preg_match_all('/(?:[^,"]*+(?:"[^"]*+")?)+[^,"]*+/', $header, $matches);

        if (!$res) {
            throw new InvalidHeader(sprintf('Failed to parse accept header: "%s"', $header));
        }

        return array_values(array_filter(array_map('trim', $matches[0])));
    }