什么是CSV,JSON的相对优点和XML的REST API? [英] What are the relative merits of CSV, JSON and XML for a REST API?

查看:1061
本文介绍了什么是CSV,JSON的相对优点和XML的REST API?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们目前正在规划一个新的 API 为应用程序和辩论,我们应该交换使用不同的数据格式。有一个相当激烈的讨论正在进行关于 CSV JSON的相对优点 XML

基本上,争论的关键是,我们是否应该支持的缺乏递归(的 CSV ,因为在所有的即其具有具有文档多个作者多次引用要求多个API调用来获取所有信息 )。

在从网​​络的API 和事情可以做,以使更容易与我们的<$ C $工作的开发人员生活的信息时,你可能有经验C> API 。


我们的决定:


  

我们已经决定提供 XML JSON 由于在递归难度 CSV 需要一个单一的逻辑操作的多个调用。 JSON 不具有的Qt Protocol Buffers的似乎并不有一个非字母PHP 实施,使他们走出的那一刻太多,但可能会被最终支持。



解决方案

CSV是正确的。 JSON比XML更紧凑的对象符号,所以,如果你正在寻找大批量它的优点。 XML有更广阔的市场渗透率(我爱这句话),是由所有的编程语言和他们的核心框架的支持。 JSON是到达那里(如果尚未有)。

就个人而言,我喜欢的支架。我敢打赌更多的开发者是舒适与XML数据比JSON。

We're currently planning a new API for an application and debating the various data formats we should use for interchange. There's a fairly intense discussion going on about the relative merits of CSV, JSON and XML.

Basically, the crux of the argument is whether we should support CSV at all because of the lack of recursion (i.e. having a document which has multiple authors and multiple references would require multiple API calls to obtain all the information).

In the experiences you may have had when working with information from Web APIs and things we can do to make the lives easier for the developers working with our API.


Our decision:

We've decided to provide XML and JSON due to the difficulty in recursion in CSV needing multiple calls for a single logical operation. JSON doesn't have a parser in Qt and Protocol Buffers doesn't seem to have a non-alpha PHP implementation so they are out for the moment too but will probably be supported eventually.

解决方案

CSV is right out. JSON is a more compact object notation than XML, so if you're looking for high volumes it has the advantage. XML has wider market penetration (I love that phrase) and is supported by all programming languages and their core frameworks. JSON is getting there (if not already there).

Personally, I like the brackets. I would bet more devs are comfortable with working with xml data than with json.

这篇关于什么是CSV,JSON的相对优点和XML的REST API?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆