> For the complete documentation index, see [llms.txt](https://book.restfulnode.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://book.restfulnode.com/part-2/chapter-2/2-rest-vs-http.md).

# REST vs. HTTP

Two of the most confusing and misunderstood concepts used by everyday web developers are HTTP and REST, because there are developers who have worked for decades in this industry and still do not know the differences between those two. We are going to clear that up before moving onto the details of what REST and HTTP actually are.

**REST** is an **architectural style guideline** which enforces the correct use of the HTTP transport protocol. **HTTP** is a communications **protocol** that transports messages over a network. The HTTP 1.1 protocol was built to be the ideal protocol to follow the principles and constraints of REST.

One way to look at the relationship between HTTP and REST is that **REST is the design**, and **HTTP 1.1 is an implementation** of that design. In reality the two were designed simultaneously.

So are REST and HTTP the same? No, they are not. HTTP stands for HyperText Transfer Protocol and is a way to transfer files. This protocol is used to link pages of hypertext on the world-wide-web. However, there are other transfer protocols available like FTP and [Gopher](https://en.wikipedia.org/wiki/Gopher_\(protocol\)). Representational State Transfer, or REST, is a set of constraints that ensure a scalable, fault-tolerant and easily extensible system.

One thing that confuses people, is that REST and HTTP seem to be used hand-in-hand. After all, the world-wide-web itself runs on HTTP, and it makes sense. However, there is nothing in the REST constraints that make the usage of HTTP as a mandatory transfer protocol. It's perfectly possible to use other transfer protocols like SMTP, SMS, or even Bluetooth. An API could use any protocol and could still very well be a RESTful API.

In practice, most - if not all - RESTful APIs currently use HTTP as a transport layer, since the infrastructure, servers, and client libraries for HTTP are widely available already.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://book.restfulnode.com/part-2/chapter-2/2-rest-vs-http.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
