Skip to content
PHP Ecosystem
Explore

MethodNotAllowedHttpException

API reference › yii › web › MethodNotAllowedHttpException

classyii\web\MethodNotAllowedHttpException
ExtendsHttpException » yii\base\UserException » yii\base\Exception » Exception
Since2.0
Sourceframework/web/MethodNotAllowedHttpException.php

MethodNotAllowedHttpException represents a “Method Not Allowed” HTTP exception with status code 405.

See also: https://tools.ietf.org/html/rfc7231#section-6.5.5.

PropertyTypeDescriptionDefined by
$statusCodeintHTTP status code, such as 403, 404, 500, etc. Default: null.HttpException
MethodDescriptionDefined by
__construct()Constructor.MethodNotAllowedHttpException
getName()HttpException
public function __construct(string|null $message = null, int $code = 0, Throwable|null $previous = null)

Constructor.

Parameters

ParameterTypeDescription
$messagestring|nullError message
$codeintError code
$previousThrowable|nullThe previous exception used for the exception chaining.