官术网_书友最值得收藏!

RESTful API

REST stands for Representational State Transfer. It was first defined in Dr. Roy Fielding's dissertation (Architectural Styles and the Design of Network-Based Software Architectures) back in 2000. This dissertation is considered to be the bible in the web domain. REST is not a standard or protocol; it is more like a software architectural style. Many engineers follow this architectural style to build their applications, such as eBay, Facebook, and Google Maps. These web applications serve huge amounts of traffic every second, so you can see that REST really is a scalable architecture style. And when we say RESTful API, we are referring to an API that conforms to the REST constraints/principles.

REST Constraints/Principles

There are five important constraints/principles for the REST architecture style:

  • Client-server: There is an interface between the client and the server. The client and server communicate through this interface and are independent of each other. Either side can be replaced as long as the interface stays the same. Requests always come from the client-side.
  • Stateless: There is no concept of state for a request. Every request is considered to be independent and complete. There is no dependence on the previous request nor dependence on a session to maintain the connection status.
  • Cacheable: Things are cacheable on the server or client-side to improve performance.
  • Layered system: There can be multiple layers in the system, and the goal here is to hide the actual logic/resources. These layers can perform different functions, such as caching and encryption.
  • Uniform interface: The interface stays the same. This helps to decouple the client and server logic.
主站蜘蛛池模板: 县级市| 巨鹿县| 肇州县| 平武县| 买车| 双辽市| 长泰县| 江阴市| 霸州市| 娱乐| 尤溪县| 贺州市| 清原| 图木舒克市| 筠连县| 柳江县| 奇台县| 东源县| 柘城县| 尼玛县| 邓州市| 安泽县| 彝良县| 绥棱县| 谷城县| 巴林右旗| 乌鲁木齐市| 含山县| 田阳县| 大关县| 叶城县| 贵德县| 南宫市| 平远县| 凉山| 新兴县| 康保县| 宁强县| 浏阳市| 井冈山市| 遂溪县|