yiisoft/yii2 · error · NotAcceptableHttpException

None of your requested content types is supported.

Error message

None of your requested content types is supported.

What it means

Error "None of your requested content types is supported." thrown in yiisoft/yii2.

Source

Thrown at framework/filters/ContentNegotiator.php:224

                $response->format = $this->formats[$type];
                $response->acceptMimeType = $type;
                $response->acceptParams = $params;
                return;
            }
        }

        foreach ($this->formats as $type => $format) {
            $response->format = $format;
            $response->acceptMimeType = $type;
            $response->acceptParams = [];
            break;
        }

        if (isset($types['*/*'])) {
            return;
        }

        throw new NotAcceptableHttpException('None of your requested content types is supported.');
    }

    /**
     * Negotiates the application language.
     * @param Request $request
     * @return string the chosen language
     */
    protected function negotiateLanguage($request)
    {
        if (!empty($this->languageParam) && ($language = $request->get($this->languageParam)) !== null) {
            if (is_array($language)) {
                // If an array received, then skip it and use the first of supported languages
                return reset($this->languages);
            }
            if (isset($this->languages[$language])) {
                return $this->languages[$language];
            }
            foreach ($this->languages as $key => $supported) {

View on GitHub (pinned to 66f00d18a2)

When it happens

Trigger: Thrown at framework/filters/ContentNegotiator.php:224 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of yiisoft/yii2@66f00d18a2 (2026-08-17). Data as JSON: /api/errors/9e5a39d9369edabc. Report an issue: GitHub.