RESTful API Standard

Table of Contents:

Introduction

What is REST?

Principles of REST

Resource

HTTP Methods

Status Codes

Introduction

This document provides guidelines and examples for the web APIs that adhere to the Representational State Transfer (REST) architectural style.

What is REST?

Representational State Transfer (REST) is a set of guidelines for designing software systems for the Internet. It’s like a blueprint for building the World Wide Web. It lays out rules to ensure that different parts of the web (like websites or apps) can talk to each other efficiently and securely.

Principles of REST

Resource

HTTP Methods

Status Codes

Example

API Endpoint: “/books”

  Method: GET - This method retrieves all books.

  Method: POST - This method creates a new book.

API Endpoint: “/books/{id}”

  Method: GET - This method retrieves the book with {id}.

  Method: PUT - This method updates the existing book with {id}.

  Method: DELETE - This method deletes the existing book with {id}.