V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
n00b1
V2EX  ›  问与答

请求RESTful的解释

  •  
  •   n00b1 · 2013-01-11 14:57:43 +08:00 · 2877 次点击
    这是一个创建于 4135 天前的主题,其中的信息可能已经有所发展或是发生改变。
    For an API or web service to be RESTful, it must do the following:

    1, Separate the client from the server
    2, Not hold state between requests (meaning that all the information necessary to respond to a request is available in each individual request; no data, or state, is held by the server from request to request)
    3, Use HTTP and HTTP methods (as explained in the next section).

    如上这段是我摘抄的第2、3点我大致能够理解(也麻烦各位帮忙看看理解是否正确)
    2, 一旦有从client到server的request,server都会无条件的返回相应的response,譬如,我按照twitter给出的API去拿twits,twitter立马就会给予回应,返回相应的twits不能不给
    3, 就是用那些HTTP (GET, POST, PUT, DELETE)方法

    唯独第一点有点不明白,客户和服务器分离?客户服务器本来就是分离的呀,难道有不分离的情况?
    2 条回复    1970-01-01 08:00:00 +08:00
    binux
        1
    binux  
       2013-01-11 15:03:30 +08:00   ❤️ 1
    “一旦有从client到server的request,server都会无条件的返回相应的response,譬如,我按照twitter给出的API去拿twits,twitter立马就会给予回应,返回相应的twits不能不给”

    可以不给,但是必须告诉你,我不给你
    ninion
        2
    ninion  
       2013-01-11 16:31:07 +08:00
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1358 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 28ms · UTC 23:30 · PVG 07:30 · LAX 16:30 · JFK 19:30
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.