什么是CSV,JSON的相对优点和XML的REST API? [英] What are the relative merits of CSV, JSON and XML for a 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 ofCSV
,JSON
andXML
.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 hasmultiple authors
andmultiple references
would requiremultiple API calls
to obtain all theinformation
).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 ourAPI
.
Our decision:
We've decided to provide
XML
andJSON
due to the difficulty in recursion inCSV
needing multiple calls for a single logical operation.JSON
doesn't have a parser inQt
andProtocol Buffers
doesn't seem to have anon-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屋!