DEV Community

Discussion on: What is a REST API?

Collapse
 
napcoder profile image
Marco Travaglini

Formally correct introduction. But… having developed restful api for a while, Imho the first 3 rules are the core and really important to understand what restful is. You cannot have a restful api without respecting the first 3 constraints, but you can implement a restful api ignoring 4,5,6. And never used the 6th until now.

Collapse
 
andychiare profile image
Andrea Chiarelli

you can implement a restful api ignoring 4,5,6.

Formally not correct. To get properly RESTful systems, you must implement ALL the non-optional constraints. If not, you are just implementing HTTP-based APIs, also known as Web APIs.
See this to learn more: dzone.com/articles/please-dont-cal...

Collapse
 
napcoder profile image
Marco Travaglini

Yes, formally. The article you have posted is emphasizing a key point in uniform interface, that is in fact one of the first 3 constraints in the article we are commenting. I know that to call an api restful you have to formally support at least five of the constraints with exception of cod, I’m just saying some of them have a really different weight. In an introductory post for people new to rest, I’d like to spent more words on the really core features of a rest api, instead of write the same number of words for uniform interface and cod.
But this is only my opinion, I’m more practical and less formal 😁

Thread Thread
 
andychiare profile image
Andrea Chiarelli

I totally understand your point.
Maybe it's age, but I've seen too many times misnaming, misunderstanding, and misusing technologies in the name of being practical... 😉

Thread Thread
 
napcoder profile image
Marco Travaglini

You are probably right.