What and Why RESTFUL

WaiChun
2 min readJun 15, 2020
REST

Before talk about RESTFUL, we have to understand what is REST.

REST aka Representational State Transfer its a software architect develop by Prof Roy Fielding at 2000. It replace the old SOAP and became the new Web API standard.

what is Web API?

If we want get something from a website, we access the URL http://localhost:8080/product/1, and it will display the product page for item 1, but it is a HTML page, it contain the UI and Data. For normal user, it doesn’t matter but for a server, server hard to get data from HTML page.

Above scenario, if the URL is not returning HTML page but just item 1 data, then the URL can called as Web API.

And REST is a API design, the most common data for REST is XML and JSON

Principle of REST

  • Stateless
  • Multiple way represent data source (XML/ JSON)
  • Client–server
  • Layer system

Conclusion

What is RESTFUL?

  • fulfill REST principle
  • based on http

Why RESTFUL?

  • separate front-end/back-end
  • improve API importance
  • easy for back-end develop and test

REST is a web service of ROA ( Resource-Oriented Architecture)

--

--