What exactly is RESTful programming?

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

What exactly is RESTful programming?

30条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2020-11-21 06:47

    If I had to reduce the original dissertation on REST to just 3 short sentences, I think the following captures its essence:

    1. Resources are requested via URLs.
    2. Protocols are limited to what you can communicate by using URLs.
    3. Metadata is passed as name-value pairs (post data and query string parameters).

    After that, it's easy to fall into debates about adaptations, coding conventions, and best practices.

    Interestingly, there is no mention of HTTP POST, GET, DELETE, or PUT operations in the dissertation. That must be someone's later interpretation of a "best practice" for a "uniform interface".

    When it comes to web services, it seems that we need some way of distinguishing WSDL and SOAP based architectures which add considerable overhead and arguably much unnecessary complexity to the interface. They also require additional frameworks and developer tools in order to implement. I'm not sure if REST is the best term to distinguish between common-sense interfaces and overly engineered interfaces such as WSDL and SOAP. But we need something.

提交回复
热议问题