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.
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
- Go to
Extend
from the administrative toolbar and install the following Web Services modules:Serialization
,RESTful Web Services
,REST UI
, andHTTP Basic Authentication
:
- Go to
Configuration
and click onREST
underWeb Services
to configure the available endpoints.
- Click on the
Enable
button for theContent
row:
- With the endpoint enabled...