function Request::getRequestFormat
Gets the request format.
Here is the process to determine the format:
- format defined by the user (with setRequestFormat())
- _format request attribute
- $default
See also
getPreferredFormat
2 calls to Request::getRequestFormat()
- Request::duplicate in vendor/
symfony/ http-foundation/ Request.php - Clones a request and overrides some of its parameters.
- Request::getPreferredFormat in vendor/
symfony/ http-foundation/ Request.php - Gets the preferred format for the response by inspecting, in the following order:
File
-
vendor/
symfony/ http-foundation/ Request.php, line 1276
Class
- Request
- Request represents an HTTP request.
Namespace
Symfony\Component\HttpFoundationCode
public function getRequestFormat(?string $default = 'html') : ?string {
$this->format ??= $this->attributes
->get('_format');
return $this->format ?? $default;
}