What are REST APIs
- For communicating between clients and servers
- RESTFUL Web Service: Service that uses REST APIs to communicate
Benefits
- Simple and standardised approach to communication, no complications with formatting data and requests
- Industry used
- Scalable and stateless, modifications can be made easily
- High performance because it supports caching
Endpoints
- Can look like this: (example website)/api/flavours
- api just signifies that this is the api portion of the endpoint
- flavours is known as a resource, signifies that we are working with the flavours resource in this REST API
Building blocks
- Request to the server by the client
- Response sent to the client by the server
Common actions with REST API
- CRUD (Create, read, update and delete) == HTTP Methods/Operations (POST, GET, PUT, DELETE)
Requests
Made of:
- Header
- Operation
- Endpoint
- Parameter/body
Response
In the form of JSON data