0

I was confused by the distinction between REST and HTTP, and I found this article that cleared things up for me. In summary, it explained that REST is a set of general principles for web communication, whereas HTTP is a specific application-layer internet protocol. The article pointed out that HTTP lends itself to following REST principles, but there are plenty of examples where applications violate REST while using HTTP.

Although I don't think the article explicitly said it, I inferred that because REST is a style rather than a protocol, you could follow REST principles with any number of protocols other than HTTP.

However, I am not aware of any REST apis that don't use HTTP. I'm also not very familiar with any of the other application-layer protocols, so I don't know whether any of them follow the principles of REST. And it is my impression that in everyday conversation, saying "a REST API" implies HTTP, because HTTP dominates the web.

Can other protocols be used for REST apis?

asked Aug 24, 2021 at 19:47
4
  • 4
    Have a look here and here. Commented Aug 24, 2021 at 20:15
  • 1
    see Why do 'some examples' and 'list of things' questions get closed? Commented Aug 24, 2021 at 20:48
  • @gnat thank you for that feedback. I've reworded my question accordingly Commented Aug 24, 2021 at 23:55
  • Take a look at COAP, an application protocol supporting REST. It is designed for and used in IoT Commented Aug 28, 2021 at 9:09

2 Answers 2

3

Can other protocols be used for REST apis?

Hypothetically? Yes. REST is an architectural style, anybody can use those constraints to build something new.

In practice? We've already got a world wide web (which is the problem that the REST architectural style is aligned with), and a standard for "self-describing messages", which is itself extensible, and we've already managed to standardize HTTP/2 as a successor to HTTP/1, and have made progress on HTTP/3 as a successor to HTTP/2.

So you probably aren't going to see the introduction of another "web scale" application based on REST, unless someone comes up with something that is significantly better than the web-as-it-is.

answered Aug 25, 2021 at 15:25
0

There probably are protocols other than REST that have already been using REST, you just need to look at environments that have the same limitations that REST tried to solve, i.e "slow", high latency, distributed network. Slow is relative, e.g. memory access in computer is slow and that's why they have caches, like REST.

On the other hand, the internet is not "slow and has high latency" anymore like how it was back then, that's why we find REST not being followed and people just write HTTP APIs.

Yet, some developers are used to REST, sometimes it's being used in environments that don't need it. For example, I have seen REST is being followed in communication using Kafka messages.

answered Aug 27, 2021 at 22:40

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.