What are REST resources?

后端 未结 11 1141
青春惊慌失措
青春惊慌失措 2020-11-29 20:53

What are REST resources and how do they relate to resource names and resource representations?

I read a few articles on the subject, but they were too abstract and t

11条回答
  •  失恋的感觉
    2020-11-29 21:47

    The reason why articles on REST resources are abstract is because the concept of a REST resource is abstract. It's basically "whatever thing is accessed by the URL you supply". So, in your example, the resource would be the list of two users starting at offset 5 in some bigger list. Note that, how the resource is implemented is a detail you don't care about unless you are the one writing the implementation.

    Is the following URL a resource?

    The URL is not a resource, it is a label that identifies the resource, it is, if you like, the name of the resource.

    The JSON is a representation of the resource.

提交回复
热议问题