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

关于 JSON-RPC 2.0 标准,有一句描述无法理解

  •  1
     
  •   iKID · 2017-09-17 06:47:56 +08:00 · 2136 次点击
    这是一个创建于 2421 天前的主题,其中的信息可能已经有所发展或是发生改变。

    英文原文:

    6 Batch

    If the batch rpc call itself fails to be recognized as an valid JSON or as an Array with at least one value, the response from the Server MUST be a single Response object. If there are no Response objects contained within the Response array as it is to be sent to the client, the server MUST NOT return an empty Array and should return nothing at all.

    中文译文:

    若批量调用的 rpc 操作本身非一个有效 json 或一个至少包含一个值的数组,则服务端返回的将单单是一个响应对象而非数组。若批量调用没有需要返回的响应对象,则服务端不需要返回任何结果且必须不能返回一个空数组给客户端。

    原文地址: http://www.jsonrpc.org/specification#batch

    译文地址: http://wiki.geekdream.com/Specification/json-rpc_2.0.html

    老实说,加粗的地方有看没有懂,求达人解释下 0 0

    3 条回复    2017-09-17 18:50:15 +08:00
    watzds
        1
    watzds  
       2017-09-17 09:17:33 +08:00 via Android   ❤️ 1
    我觉得是,非一个有效 json 或"非"一个至少包含一个值的数组
    mcfog
        2
    mcfog  
       2017-09-17 10:16:34 +08:00
    自己往下拉看 example 里 batch 相关的
    iKID
        3
    iKID  
    OP
       2017-09-17 18:50:15 +08:00
    @watzds 明白了!
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2388 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 24ms · UTC 11:53 · PVG 19:53 · LAX 04:53 · JFK 07:53
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.