public function Request::getContentType

Gets the format associated with the request.

@api

Return value

string|null The format (null if no content type is present)

File

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

Class

Request
Request represents an HTTP request.

Namespace

Symfony\Component\HttpFoundation

Code

public function getContentType() {
  return $this
    ->getFormat($this->server
    ->get('CONTENT_TYPE'));
}