diff --git a/core/modules/rest/src/Plugin/rest/resource/EntityResource.php b/core/modules/rest/src/Plugin/rest/resource/EntityResource.php index b775d29..ec1bcf8 100644 --- a/core/modules/rest/src/Plugin/rest/resource/EntityResource.php +++ b/core/modules/rest/src/Plugin/rest/resource/EntityResource.php @@ -108,7 +108,7 @@ public function post(EntityInterface $entity = NULL) { $this->logger->notice('Created entity %type with ID %id.', array('%type' => $entity->getEntityTypeId(), '%id' => $entity->id())); // 201 Created responses have an empty body. - $url = $entity->urlInfo('canonical', ['absolute' => TRUE, 'alias' => FALSE])->toString(TRUE); + $url = $entity->toUrl('canonical', ['absolute' => TRUE, 'alias' => FALSE])->toString(TRUE); $response = new ResourceResponse(NULL, 201, ['Location' => $url->getGeneratedUrl()]); $response->addCacheableDependency($url); return $response;