Drupal 8 RESTful Web Services | Drupal 8

Drupal 8 RESTful Web Services

Submitted by editor on Wed, 10/19/2016 - 17:41
Question

How to use the drupal 8 native webservices REST API ?

Step 1: Activate RESTful Webservice

Active modules:
HAL (hal)
RESTful Web Services (rest)    
HTTP Basic Authentication (basic_auth)

Download and active contrib modules:
REST UI (restui)

Step 2: Configure

Go to the Rest configure page (Administration -> Configuration -> Web services -> Rest )

- Select the service / Url to enable webservice
- Select the Methode (GET/POST/DELETE/PATCH)
- Select request formats (hal_json, json, xml ... Ex, here : hal_json)
- Select Authentication type (here : basic_auth)

 

Step 3 : Call Web Services

Example : Read a node
http://mysite.com/node/1?_format=hal_json

Add new comment