function NoSerializationClassTestResource::post

Same name in other branches
  1. 9 core/modules/rest/tests/modules/rest_test/src/Plugin/rest/resource/NoSerializationClassTestResource.php \Drupal\rest_test\Plugin\rest\resource\NoSerializationClassTestResource::post()
  2. 8.9.x core/modules/rest/tests/modules/rest_test/src/Plugin/rest/resource/NoSerializationClassTestResource.php \Drupal\rest_test\Plugin\rest\resource\NoSerializationClassTestResource::post()
  3. 11.x core/modules/rest/tests/modules/rest_test/src/Plugin/rest/resource/NoSerializationClassTestResource.php \Drupal\rest_test\Plugin\rest\resource\NoSerializationClassTestResource::post()

Responds to a POST request.

Parameters

array $data: An array with the payload.

Return value

\Drupal\rest\ResourceResponse

File

core/modules/rest/tests/modules/rest_test/src/Plugin/rest/resource/NoSerializationClassTestResource.php, line 29

Class

NoSerializationClassTestResource
Class used to test that serialization_class is optional.

Namespace

Drupal\rest_test\Plugin\rest\resource

Code

public function post(array $data) {
    return new ResourceResponse($data);
}

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