{"record":{"id":"8fb75b03d87c1108","repo":"yiisoft/yii2","slug":"the-requested-response-format-is-not-supported-f","errorCode":null,"errorMessage":"The requested response format is not supported: $format","messagePattern":"The requested response format is not supported: \\$format","errorType":"http","errorClass":"NotAcceptableHttpException","httpStatus":406,"severity":"error","filePath":"framework/filters/ContentNegotiator.php","lineNumber":196,"sourceCode":"     * @param Response $response\n     * @throws BadRequestHttpException if an array received for GET parameter [[formatParam]].\n     * @throws NotAcceptableHttpException if none of the requested content types is accepted.\n     */\n    protected function negotiateContentType($request, $response)\n    {\n        if (!empty($this->formatParam) && ($format = $request->get($this->formatParam)) !== null) {\n            if (is_array($format)) {\n                throw new BadRequestHttpException(\"Invalid data received for GET parameter '{$this->formatParam}'.\");\n            }\n\n            if (in_array($format, $this->formats)) {\n                $response->format = $format;\n                $response->acceptMimeType = null;\n                $response->acceptParams = [];\n                return;\n            }\n\n            throw new NotAcceptableHttpException('The requested response format is not supported: ' . $format);\n        }\n\n        $types = $request->getAcceptableContentTypes();\n        if (empty($types)) {\n            $types['*/*'] = [];\n        }\n\n        foreach ($types as $type => $params) {\n            if (isset($this->formats[$type])) {\n                $response->format = $this->formats[$type];\n                $response->acceptMimeType = $type;\n                $response->acceptParams = $params;\n                return;\n            }\n        }\n\n        foreach ($this->formats as $type => $format) {\n            $response->format = $format;","sourceCodeStart":178,"sourceCodeEnd":214,"githubUrl":"https://github.com/yiisoft/yii2/blob/66f00d18a29b520f85e8e8f1e32d1e7e7b556cac/framework/filters/ContentNegotiator.php#L178-L214","documentation":"Error \"The requested response format is not supported: $format\" thrown in yiisoft/yii2.","triggerScenarios":"Thrown at framework/filters/ContentNegotiator.php:196 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"66f00d18a29b520f85e8e8f1e32d1e7e7b556cac","analyzedAt":"2026-08-17T05:17:23.470Z","schemaVersion":2},"datasetVersion":"2026-08-17T09:17:11.063Z"}