What's the difference between REST & RESTful

后端 未结 15 1312
情深已故
情深已故 2020-12-11 15:13

What\'s the difference between a REST system and a system that is RESTful?

From a few things I\'ve read most so called REST services are actually RESTful services. S

15条回答
  •  星月不相逢
    2020-12-11 15:55

    There are 4 levels of API defined in the Richardson Maturity Model. These are defined as:

    • level 0: any system that has a single endpoint for all its apis(SOAP or RPC fall in this category). Level 0 apis can also resemble "commands".

    • level 1: a ResourceUri described system. This is a system that defines multiple entity-based URIs (instead of having a single endpoint like a level 0 systems would). These URIs can use different http actions (POST, GET, PUT, etc) to implement different actions against that resource.

    • level 2: aka level 1 w/ a compliant use of Standard HTTP methods/verbs and multi status code responses

    • level 3: aka level 2 plus HATEOAS (hypermedia included in the response which describes additional calls you can make)

    While levels 1, level 2, and level 3 can be considered as REST systems, only the stricter levels (aka level 2 and level 3) are considered to be RESTful.

    So essentially all RESTful apis are REST apis, but not all REST apis are RESTful

    definition of the Richardson Maturity Model

提交回复
热议问题