Content Type

Return an array containing all the content types accepted by the request

$contentTypes = $request->getAcceptableContentTypes();

Boolean check for content types are accepted by the request

if ($request->accepts(['text/html', 'application/json'])) {
    // ...
}
Comments