In order for us to start, we require to have a clean Drupal 8.x installation.
Once this is set up, we will create our content type. For this chapter, we want to show some cars on our frontend.
In Drupal 8, we have the ability to use REST within Drupal core this means we don't need to develop this functionality as its available within Drupal 8 core just by enabling a few core modules, which we will cover in this chapter.
When we create a web service, we want to allow applications to access that data using a web service. REST stands for Representational State Transfer and it is a way that allows a request over HTTP to be actioned, whether it's GET
, POST
, PUT
, or DELETE
.
An example of this is we have a lot of data exposed using REST and it is output to a URL into a JSON format. We can access that data by going to a URL we create; these are known as endpoints and can be any type of URL, for example, /api/cars
. What we will see is data from our system formatted in JSON...