protected static function Request::initializeFormats

Initializes HTTP request formats.

3 calls to Request::initializeFormats()
Request::getFormat in drupal/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Request.php
Gets the format associated with the mime type.
Request::getMimeType in drupal/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Request.php
Gets the mime type associated with the format.
Request::setFormat in drupal/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Request.php
Associates a format with mime types.

File

drupal/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Request.php, line 1458

Class

Request
Request represents an HTTP request.

Namespace

Symfony\Component\HttpFoundation

Code

protected static function initializeFormats() {
  static::$formats = array(
    'html' => array(
      'text/html',
      'application/xhtml+xml',
    ),
    'txt' => array(
      'text/plain',
    ),
    'js' => array(
      'application/javascript',
      'application/x-javascript',
      'text/javascript',
    ),
    'css' => array(
      'text/css',
    ),
    'json' => array(
      'application/json',
      'application/x-json',
    ),
    'xml' => array(
      'text/xml',
      'application/xml',
      'application/x-xml',
    ),
    'rdf' => array(
      'application/rdf+xml',
    ),
    'atom' => array(
      'application/atom+xml',
    ),
    'rss' => array(
      'application/rss+xml',
    ),
  );
}