protected function _checkRequestMethods()
    {
        if ($this->_request()->is('put')) {
            throw new BadRequestException('JSON API does not support the PUT method, use PATCH instead');
        }

        if (!$this->_request()->contentType()) {
            return true;
        }

        $jsonApiMimeType = $this->_response()->getMimeType('jsonapi');

        if ($this->_request()->contentType() !== $jsonApiMimeType) {
            throw new BadRequestException("JSON API requests with data require the \"$jsonApiMimeType\" Content-Type header");
        }

        return true;
    }
protected function _checkRequestMethods()
    {
        if ($this->_request()->is('put')) {
            throw new BadRequestException('JSON API does not support the PUT method, use PATCH instead');
        }

        if (!$this->_request()->contentType()) {
            return true;
        }

        $jsonApiMimeType = $this->_response()->getMimeType('jsonapi');

        if ($this->_request()->contentType() !== $jsonApiMimeType) {
            throw new BadRequestException("JSON API requests with data require the \"$jsonApiMimeType\" Content-Type header");
        }

        return true;
    }
protected function _checkRequestMethods ( ) { if ( $ this -> _request ( ) -> is ( 'put' ) ) { throw new BadRequestException ( 'JSON API does not support the PUT method, use PATCH instead' ) ; } if ( ! $ this -> _request ( ) -> contentType ( ) ) { return true ; } $ jsonApiMimeType = $ this -> _response ( ) -> getMimeType ( 'jsonapi' ) ; if ( $ this -> _request ( ) -> contentType ( ) !== $ jsonApiMimeType ) { throw new BadRequestException ( "JSON API requests with data require the \"$jsonApiMimeType\" Content-Type header" ) ; } return true ; }
Override ApiListener method to enforce required JSON API request methods.

@throws \Cake\Http\Exception\BadRequestException
@return bool
Override ApiListener method to enforce required JSON API request methods .