> For the complete documentation index, see [llms.txt](https://ankit-apdc.gitbook.io/system-design/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ankit-apdc.gitbook.io/system-design/building-blocks/rest-api.md).

# REST APIs

REST stands for REpresentational State Transfer, and API means Application Programming Interface

**RE**presentational **S**tate **T**ransfer, or REST, is a set of constraints that ensure a scalable, fault-tolerant and easily extendible system

## An Overview

* It fits in microservice architecture for connecting them together
* Every microservice has an endpoint, which can be accessed by other services
* Generally response is shared in json format (most commonly used, XML is another format)
* It uses HTTP as the standard protocal for sharing resource between client and server

> "**Microservices** - also known as the **microservice** architecture - is an architectural style that structures an **application** as a collection of services that are. Highly maintainable and testable. Loosely coupled. Independently deployable. Organized around business capabilities."

{% hint style="success" %}
**Properties**

* **Uniform Interface:** service is resource based (different endpoint for each resource), self descriptive, and manipulation of data is allowed through representation
* **Stateless:** no need to explicitly store state, everything should be handled through links or input variables
* **Cachable:** web-driver stores it
* **Client server:** client code and back-end server could be separate
  {% endhint %}

## Request Types and Their Actions

## Error code

## Basics of HTTP and HTTPS Protocol

## Elements of HTTP Get Request

##

## References for Further Understanding

<https://www.imaginarycloud.com/blog/flask-python/>

{% embed url="<https://www.tutorialspoint.com/restful/restful_caching.htm>" %}

{% embed url="<https://restcookbook.com/Miscellaneous/rest-and-http/#:~:text=Note%20that%20there%20is%20also,HTTP%20as%20their%20transfer%20protocol>." %}

{% embed url="<https://www.freecodecamp.org/news/http-and-everything-you-need-to-know-about-it/>" %}
