# RESTful API

> What is a RESTful API?

<br>

### REST Characteristics

* `Client-server architecture`
  * The client handles user-related processing,
  * The server provides REST APIs,
  * Allowing `roles` to be clearly `distinguished` and operate `separated` with a `consistent interface`
* `Statelessness (stateless)`
  * REST is `stateless` because it leverages the characteristics of HTTP
  * The server does not need to remember `state information` to perform tasks; it only needs to process incoming requests, making implementation simple and straightforward
* `Cacheability (cacheable)`
  * Caching is required to efficiently handle large volumes of requests
  * Using caching improves response times and, since REST Server transactions do not occur, can improve overall response time, performance, and server resource utilization
* `Uniform interface (Uniform)`
  * An architecture that enables `manipulation` of resources identified by `URI` and can be used on `all platforms` as long as it follows the `Http standard`
  * In other words, **it is not dependent on any specific language or technology**

<br>

### Core Rules

* URIs should represent the resource information
* `Actions` on resources should be expressed using `HTTP Methods` (GET, POST, PUT, DELETE, etc.)

<br>

### What is a RESTful API?

> RESTful is a way to use REST properly, and it has not been officially published by anyone

* **Resources must be identifiable**
  * It should be possible to tell `what resource` is being controlled just from the URL
* **Actions must be explicit**
  * Using GET to perform UPDATE and DELETE -> X


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://chloe-codes1.gitbook.io/til/network/http/05_restful_api.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
