-1

I don't understand why suddenly there is this term "REST API". As far as I've understood it means "The client requests some sort of representation of a state". Thus, every server in the world that serves HTML pages is suddenly a "REST API"?? The state is the content of the URL and the representation is the HTML code, right? That's the oldest thing in the world, I request a resource and I get the resource. Why is this suddenly a REST API or am I not understanding something subtle here? Also when I connect to an SQL Server and say "SELECT * FROM client_table" I get the state (the content of the table?) from this request. The form of representation could be a dataframe which I use to contain the received data. Again, I just request data and I get the data, is this suddenly a REST API too? To me everything is a REST API, networking itself is always REST API: request data -> get data. I feel like there must be something subtle that I don't understand and I cannot define what it is? Why does this term exist?

Robert
  • 432
  • 1
  • 4
  • 15
  • 1
    https://en.wikipedia.org/wiki/Representational_state_transfer – ymoreau Jan 03 '20 at 13:26
  • 1
    Check out this Question and the top answer: https://stackoverflow.com/questions/671118/what-exactly-is-restful-programming – plr108 Jan 03 '20 at 13:26
  • 1
    _Hypermedia_ is possibly the answer you are looking for. The term _REST_ was created by Roy T. Fielding and such architectural style is defined in the [chapter 5](https://www.ics.uci.edu/~fielding/pubs/dissertation/rest_arch_style.htm) of his dissertation. – cassiomolin Jan 03 '20 at 14:24

1 Answers1

0

I don't understand why suddenly there is this term "REST API"

It's not particularly sudden; the development of REST begins in roughly 1994; the contrast of REST with other approaches (SOAP, XML-RPC) goes back to the early part of this millennium.

Randall Munroe's comic explaining that there are thousands of people learning things that "everyone knows" every day

every server in the world that serves HTML pages is suddenly a "REST API"?

Yes, that's exactly right. The world wide web is the reference application for the REST architectural style, and it was catastrophically successful -- we're able to do amazing things using general purpose components that respect shared, well-documented standards.

when I connect to an SQL Server... is this suddenly a REST API too?

No, it is not.

I feel like there must be something subtle that I don't understand and I cannot define what it is?

Fielding described the REST architectural style in his thesis, that's the place to start. The key ideas to pay attention to: caching, and the uniform interface. IT would also be good to review what he had to say about hypermedia.

Why does this term exist?

Historically, as a shorthand to distinguish resource oriented approaches to others.

For instance, in the late 90s, REST stood in contrast to SOAP and XML/RPC, which used HTTP as dumb transport. Similarly, in 2006(ish), folks were noticing that out of the box Rails was procedure oriented, rather than resource oriented.

In other words, REST was a sort of shorthand for "I do not like Thing. It should be more like the world wide web."

VoiceOfUnreason
  • 52,766
  • 5
  • 49
  • 91