What exactly is RESTful programming?

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

What exactly is RESTful programming?

30条回答
  •  野性不改
    2020-11-21 06:25

    Old question, newish way of answering. There's a lot of misconception out there about this concept. I always try to remember:

    1. Structured URLs and Http Methods/Verbs are not the definition of restful programming.
    2. JSON is not restful programming
    3. RESTful programming is not for APIs

    I define restful programming as

    An application is restful if it provides resources (being the combination of data + state transitions controls) in a media type the client understands

    To be a restful programmer you must be trying to build applications that allow actors to do things. Not just exposing the database.

    State transition controls only make sense if the client and server agree upon a media type representation of the resource. Otherwise there's no way to know what's a control and what isn't and how to execute a control. IE if browsers didn't know

    tags in html then there'd be nothing for you to submit to transition state in your browser.

    I'm not looking to self promote, but i expand on these ideas to great depth in my talk http://techblog.bodybuilding.com/2016/01/video-what-is-restful-200.html .

    An excerpt from my talk is about the often referred to richardson maturity model, i don't believe in the levels, you either are RESTful (level 3) or you are not, but what i like to call out about it is what each level does for you on your way to RESTful

提交回复
热议问题