What exactly is RESTful programming?

前端 未结 30 3763
Happy的楠姐
Happy的楠姐 2020-11-21 06:02

What exactly is RESTful programming?

30条回答
  •  梦毁少年i
    2020-11-21 06:41

    I see a bunch of answers that say putting everything about user 123 at resource "/user/123" is RESTful.

    Roy Fielding, who coined the term, says REST APIs must be hypertext-driven. In particular, "A REST API must not define fixed resource names or hierarchies".

    So if your "/user/123" path is hardcoded on the client, it's not really RESTful. A good use of HTTP, maybe, maybe not. But not RESTful. It has to come from hypertext.

提交回复
热议问题