5. DELETE for deleting content entities

Follow these steps to expose resources to DELETE requests:

  1. Configuration
  2. Test with a DELETE request

Configuration

This builds upon the GET, POST and PATCH examples of the previous pages.

See Getting started: REST configuration & REST request fundamentals — Configuration

Sample requests below assume this configuration:

4. PATCH for updating content entities

Follow these steps to expose resources to PATCH requests:

  1. Configuration
  2. Test with a PATCH request

Configuration

This builds upon the GET and POST examples of the previous pages.

See Getting started: REST configuration & REST request fundamentals — Configuration

Sample requests below assume this configuration:

RESTful Web Services API

The RESTful Web Services API is new in Drupal 8.

For each REST resource, you can specify the supported verbs, and for each verb, you can specify the serialization formats & authentication mechanisms.

API features

Ordered by most to least frequently used APIs:

Endpoint

Overview

Endpoint module is a framework which allows Drupal acts as a light endpoint.

The module was designed specifically for REST API. It contains a router that allows to follow REST style in your URLs. Here is an example:

JavaScript and Drupal 8 RESTful Web Services

This page aims to outline how to use JavaScript to communicate with Drupal 8's RESTful services. It is broken into sections per entity type.

It outlines:

  1. which HTTP method to use (GET, POST, PATCH, or DELETE) on which URL
  2. which headers to send
  3. what response can be expected from the server

For the following entity types:

RESTful best practices for Drupal

The RESTful module achieves a practical RESTful for Drupal following best practices.

Further documentation and examples can be found at the RESTful module wiki.

Concept

The following also describes the difference between other modules such as RestWs and Services Entity.

Pages

Subscribe with RSS Subscribe to RSS - services