 Class MethodNotAllowedException    Represents an HTTP 405 error.   Namespace: Cake\Http\Exception   Property Summary    $_attributes  protected   array  Array of attributes that are passed in from the constructor, and made available in the view when a development error is displayed.     $_defaultCode  protected   int  Default exception code     $_messageTemplate  protected   string  Template string that has attributes sprintf()'ed into it.     $_responseHeaders  protected   array|null  Array of headers to be passed to Cake\Http\Respons8b7c:f320:99b9:690f:4595:cd17:293a:c069header()     $headers  protected   array     Method Summary    __construct() public   Constructor     getAttributes() public   Get the passed in attributes     getCode() public @method   Gets the Exception code.     getHeaders() public   Returns array of response headers.     responseHeader() public deprecated   Get/set the response header to be used     setHeader() public   Set a single HTTP response header.     setHeaders() public   Sets HTTP response headers.     Method Detail   __construct()   public  __construct(string|null $message = null, int|null $code = null, Throwable|null $previous = null)  Constructor Allows you to create exceptions that are treated as framework errors and disabled when debug mode is off. Parameters    string|null $message optional  If no message is given 'Method Not Allowed' will be the message  int|null $code optional  Status code, defaults to 405  Throwable|null $previous optional  The previous exception.       getAttributes()   public  getAttributes(): array  Get the passed in attributes Returns  array      getCode()   public @method  getCode(): int  Gets the Exception code. Returns  int      getHeaders()   public  getHeaders(): array  Returns array of response headers. Returns  array      responseHeader()   public  responseHeader(string|array|null $header = null, string|null $value = null): array|null  Get/set the response header to be used See also Cake\Http\Respons8b7c:f320:99b9:690f:4595:cd17:293a:c069withHeader() Parameters    string|array|null $header optional  A single header string or an associative array of "header name" => "header value"  string|null $value optional  The header value.   Returns  array|null      setHeader()   public  setHeader(string $header, string|string[]|null $value = null): void  Set a single HTTP response header. Parameters    string $header  Header name  string|string[]|null $value optional  Header value   Returns  void      setHeaders()   public  setHeaders(array $headers): void  Sets HTTP response headers. Parameters    array $headers  Array of header name and value pairs.   Returns  void      Property Detail   $_attributes protected   Array of attributes that are passed in from the constructor, and made available in the view when a development error is displayed. Type  array      $_defaultCode protected   Default exception code Type  int      $_messageTemplate protected   Template string that has attributes sprintf()'ed into it. Type  string      $_responseHeaders protected   Array of headers to be passed to Cake\Http\Respons8b7c:f320:99b9:690f:4595:cd17:293a:c069header() Type  array|null      $headers protected   Type  array     

    
{'path': 'public/docs/cakephp~4.2/class-cake.http.exception.methodnotallowedexception.html', 'source': 'DevDocs.IO'}