I am creating custom rest resource using this code:
<?php /** * Provides a resource to get view modes by entity and bundle. * * @RestResource( * id = "region_node_rest_resource", * label = @Translation("Region node rest resource"), * * uri_paths = { * "canonical" = "/standortimporter/region_node_rest_resource" * } * ) */ namespace DrupalstandortimporterPluginrestresource; use DrupalCoreSessionAccountProxyInterface; use DrupalnodeEntityNode; use DrupalrestPluginResourceBase; use DrupalrestResourceResponse; use SymfonyComponentDependencyInjectionContainerInterface; use SymfonyComponentHttpKernelExceptionAccessDeniedHttpException; use PsrLogLoggerInterface; class regionNodeRestResource extends ResourceBase { public function post() { $node = "hello here"; return new ResourceResponse($node); } }
And getting this error:
{“message”:”No route found for u0022GET /standortimporter/region_node_rest_resourceu0022″}