Using PATCH to update data
When working with RESTful Web Services, the HTTP PATCH method is used to update entities. We will use the HTTP Basic Authentication to authenticate our user and update a node.
In this recipe, we will use the exposed node endpoint to create a new piece of article content through the RESTful Web Services module.
Getting ready
We will use the Article content type provided by the standard installation. Following the Enabling RESTful interfaces recipe, you should have the REST UI module added to your Drupal installation using Composer. This can be done with the following command:
cd /path/to/drupal8 composer require drupal/restui
How to do it...
- Go to
Extendfrom the administrative toolbar and install the following Web Services modules:Serialization,RESTful Web Services,REST UI, andHTTP Basic Authentication:

- Go to
Configurationand click onRESTunderWeb Servicesto configure the available endpoints.
- Click on the
Enablebutton for theContentrow:

- With the endpoint enabled...