function ResourceBase::requestMethods

Same name and namespace in other branches
  1. 8.9.x core/modules/rest/src/Plugin/ResourceBase.php \Drupal\rest\Plugin\ResourceBase::requestMethods()
  2. 10 core/modules/rest/src/Plugin/ResourceBase.php \Drupal\rest\Plugin\ResourceBase::requestMethods()
  3. 11.x core/modules/rest/src/Plugin/ResourceBase.php \Drupal\rest\Plugin\ResourceBase::requestMethods()

Provides predefined HTTP request methods.

Plugins can override this method to provide additional custom request methods.

Return value

array The list of allowed HTTP request method strings.

1 call to ResourceBase::requestMethods()
ResourceBase::availableMethods in core/modules/rest/src/Plugin/ResourceBase.php
Returns the available HTTP request methods on this plugin.

File

core/modules/rest/src/Plugin/ResourceBase.php, line 131

Class

ResourceBase
Common base class for resource plugins.

Namespace

Drupal\rest\Plugin

Code

protected function requestMethods() {
    return [
        'HEAD',
        'GET',
        'POST',
        'PUT',
        'DELETE',
        'TRACE',
        'OPTIONS',
        'CONNECT',
        'PATCH',
    ];
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.