Book Image

Mastering Drupal 8

By : Sean Montague, Chaz Chumley, William Hurley
Book Image

Mastering Drupal 8

By: Sean Montague, Chaz Chumley, William Hurley

Overview of this book

Drupal is an open source content management system trusted by governments and organizations around the globe to run their websites. It brings with it extensive content authoring tools, reliable performance, and a proven track record of security. The community of more than 1,000,000 developers, designers, editors, and others have developed and maintained a wealth of modules, themes, and other add-ons to help you build a dynamic web experience. Drupal 8 is the latest release of the Drupal built on the Symfony2 framework. This is the largest change to the Drupal project in its history. The entire API of Drupal has been rebuilt using Symfony and everything from the administrative UI to themes to custom module development has been affected. This book will cover everything you need to plan and build a complete website using Drupal 8. It will provide a clear and concise walkthrough of the more than 200 new features and improvements introduced in Drupal core. In this book, you will learn advanced site building techniques, create and modify themes using Twig, create custom modules using the new Drupal API, explore the new REST and Multilingual functionality, import, and export Configuration, and learn how to migrate from earlier versions of Drupal.
Table of Contents (25 chapters)
Title Page
Credits
About the Author
Acknowledgments
About the Author
About the Reviewer
Customer Feedback
www.PacktPub.com
Preface

Overview of REST


REST (Representational State Transfer) is described in the original dissertation as an "architectural style for distributed hypermedia systems." There are several key features of a REST API:

  • It separates the client representation from the server data
  • It is stateless
  • It is cacheable
  • It relies on a uniform interface, generally HTTP verbs
  • It leverages a decoupled, layered system

Many people consider any API that uses a Universal Resource Indicator (URI) style to be REST by comparing it against other protocols like SOAP, AMF, or CORBA. REST, however, is specific to acting on resources using the correct HTTP verb. If you are performing some other action on the system, it's a Remote Procedure Call (RPC). The following table uses some examples to compare the two styles:

Operation

RPC style

REST style

Login

POST /login

POST /session

Logout

GET /logout

DELETE /session/id

Create user

POST /addUser

POST /user

Update a node

POST /updateNode

PATCH /node/id

With traditional REST architecture, you don't login...