UserAuthenticationController::getRequestFormat

protected UserAuthenticationController::getRequestFormat(Request $request)

Gets the format of the current request.

Parameters

\Symfony\Component\HttpFoundation\Request $request: The current request.

Return value

string The format of the request.

File

core/modules/user/src/Controller/UserAuthenticationController.php, line 277

Class

UserAuthenticationController
Provides controllers for login, login status and logout via HTTP requests.

Namespace

Drupal\user\Controller

Code

protected function getRequestFormat(Request $request) {
  $format = $request->getRequestFormat();
  if (!in_array($format, $this->serializerFormats)) {
    throw new BadRequestHttpException("Unrecognized format: $format.");
  }
  return $format;
}
doc_Drupal
2016-10-29 09:52:17
Comments
Leave a Comment

Please login to continue.