The API system has built-in content negotiation capabilities. By default, only the JSON-LD format is enabled. However, API Platform Core supports many more formats and can be extended.

API系统具有内置的内容协商功能。 默认情况下,仅启用JSON-LD格式。 但是, API Platform Core支持更多格式,并且可以扩展。

Available formats are: JSON-LD, GraphQL, JSON, JSON:API, HAL, XML, YAML, CSV, HTML (API docs).

可用格式为: JSON-LD,GraphQL,JSON,JSON:API,HAL,XML,YAML,CSV,HTML (API文档)

1. JSON-LD (1. JSON-LD)

Data is messy and disconnected. JSON-LD organizes and connects it, creating a better Web.

数据混乱且断开连接。 JSON-LD进行组织和连接,从而创建一个更好的Web。

JSON-LD is a lightweight Linked Data format. It is easy for humans to read and write. It is based on the already successful JSON format and provides a way to help JSON data interoperate at Web-scale. JSON-LD is an ideal data format for programming environments, REST Web services, and unstructured databases such as Apache CouchDB and MongoDB.

JSON-LD是一种轻量级的链接数据格式。 人类易于阅读和书写。 它基于已经成功的JSON格式,并提供了一种方法来帮助JSON数据在Web规模上进行互操作。 JSON-LD是用于编程环境,REST Web服务和非结构化数据库(例如Apache CouchDB和MongoDB)的理想数据格式。

例; (Example;)

{  "@context": "https://json-ld.org/contexts/person.jsonld",  "@id": "http://dbpedia.org/resource/John_Lennon",  "name": "John Lennon",  "born": "1940-10-09",  "spouse": "http://dbpedia.org/resource/Cynthia_Lennon"}

Linked Data empowers people that publish and use information on the Web. It is a way to create a network of standards-based, machine-readable data across Web sites. It allows an application to start at one piece of Linked Data, and follow embedded links to other pieces of Linked Data that are hosted on different sites across the Web.

链接数据可以使人们在Web上发布和使用信息。 这是一种跨网站创建基于标准的机器可读数据网络的方法。 它允许应用程序从一个链接数据段开始,并遵循嵌入的链接,这些链接指向托管在Web上不同站点上的其他链接数据段。

2. GraphQL (2. GraphQL)

A query language for your API

API的查询语言

GraphQL is a query language for APIs and a runtime for fulfilling those queries with your existing data. GraphQL provides a complete and understandable description of the data in your API, gives clients the power to ask for exactly what they need and nothing more, makes it easier to evolve APIs over time, and enables powerful developer tools.

GraphQL是API的查询语言,是用于使用现有数据来完成这些查询的运行时。 GraphQL为您的API中的数据提供了完整且易于理解的描述,使客户能够准确地询问他们需要什么,仅此而已,使随着时间的推移更容易开发API,并启用了功能强大的开发人员工具。

3. JSON (3. JSON)

JSON (JavaScript Object Notation) is a lightweight data-interchange format. It is easy for humans to read and write. It is easy for machines to parse and generate. It is based on a subset of the JavaScript Programming Language Standard ECMA-262 3rd Edition — December 1999. JSON is a text format that is completely language independent but uses conventions that are familiar to programmers of the C-family of languages, including C, C++, C#, Java, JavaScript, Perl, Python, and many others. These properties make JSON an ideal data-interchange language.

JSON (JavaScript对象表示法)是一种轻量级的数据交换格式。 人类易于阅读和书写。 机器很容易解析和生成。 它基于JavaScript编程语言标准ECMA-262第三版(1999年12月)的子集。JSON是一种文本格式,它完全独立于语言,但使用C语言家族(包括C)的程序员熟悉的约定, C ++,C#,Java,JavaScript,Perl,Python等。 这些属性使JSON成为理想的数据交换语言。

JSON is built on two structures:

JSON建立在两种结构上:

  • A collection of name/value pairs. In various languages, this is realized as an object, record, struct, dictionary, hash table, keyed list, or associative array.

    名称/值对的集合。 在各种语言中,这是作为对象 ,记录,结构,字典,哈希表,键列表或关联数组实现的。

  • An ordered list of values. In most languages, this is realized as an array, vector, list, or sequence.

    值的有序列表。 在大多数语言中,这是通过数组 ,向量,列表或序列实现的。

These are universal data structures. Virtually all modern programming languages support them in one form or another. It makes sense that a data format that is interchangeable with programming languages also be based on these structures.

这些是通用数据结构。 几乎所有现代编程语言都以一种或另一种形式支持它们。 可以与编程语言互换的数据格式也应基于这些结构,这是有道理的。

4. JSON API (4. JSON API)

A SPECIFICATION FOR BUILDING APIS IN JSON

在JSON中构建API的规范

JSON API is a format that works with HTTP. It delineates how clients should request or edit data from a server, and how the server should respond to said requests. A main goal of the specification is to optimize HTTP requests; both in terms of the number of requests and the size of data packages exchanged between clients and servers. JSON API module exposes an implementation for data stores and data structures, such as entity types, bundles, and fields.

JSON API是可与HTTP一起使用的格式。 它描述了客户端应如何从服务器请求或编辑数据,以及服务器应如何响应所述请求。 该规范的主要目标是优化HTTP请求。 无论是请求数量还是客户端和服务器之间交换的数据包的大小。 JSON API模块公开了数据存储和数据结构的实现,例如实体类型,捆绑和字段。

5. HAL —超文本应用语言 (5. HAL — Hypertext Application Language)

HAL is a simple format that gives a consistent and easy way to hyperlink between resources in your API.

HAL是一种简单的格式,它提供了一种一致且简单的方法来在API中的资源之间建立超链接。

Adopting HAL will make your API explorable, and its documentation easily discoverable from within the API itself. In short, it will make your API easier to work with and therefore more attractive to client developers.

采用HAL将使您的API具有可探索性,并且可以轻松从API本身中发现其文档。 简而言之,它将使您的API易于使用,因此对客户端开发人员更具吸引力。

APIs that adopt HAL can be easily served and consumed using open source libraries available for most major programming languages. It’s also simple enough that you can just deal with it as you would any other JSON.

使用适用于大多数主要编程语言的开源库,可以轻松提供和使用采用HAL的API。 它也非常简单,您可以像处理其他任何JSON一样处理它。

HAL provides a set of conventions for expressing hyperlinks in either JSON or XML.

HAL提供了一组用于以JSON或XML表示超链接的约定。

Instead of using ad-hoc structures, or spending valuable time designing your own format; you can adopt HAL’s conventions and focus on building and documenting the data and transitions that make up your API.

不要使用临时结构,也不要花费宝贵的时间来设计自己的格式; 您可以采用HAL的约定,并专注于构建和记录构成API的数据和转换。

HAL is a little bit like HTML for machines, in that it is generic and designed to drive many different types of application via hyperlinks. The difference is that HTML has features for helping ‘human actors’ move through a web application to achieve their goals, whereas HAL is intended for helping ‘automated actors’ move through a web API to achieve their goals.

HAL有点像用于机器HTML,因为它是通用的,旨在通过超链接来驱动许多不同类型的应用程序。 区别在于HTML具有帮助“人类参与者”通过Web应用程序实现其目标的功能,而HAL旨在帮助“自动化参与者”通过Web API实现其目标。

Having said that, HAL is actually very human-friendly too. Its conventions make the documentation for an API discoverable from the API messages themselves. This makes it possible for developers to jump straight into a HAL-based API and explore its capabilities, without the cognitive overhead of having to map some out-of-band documentation onto their journey.

话虽如此, HAL实际上也非常人性化 。 它的约定使API文档可以从API消息本身中发现。 这使开发人员可以直接跳入基于HAL的API并探索其功能,而无需将一些带外文档映射到他们的旅程中,从而节省了认知开销。

6.可扩展标记语言(XML) (6. Extensible Markup Language (XML))

Extensible Markup Language (XML) is a simple, very flexible text format derived from SGML (ISO 8879). Originally designed to meet the challenges of large-scale electronic publishing, XML is also playing an increasingly important role in the exchange of a wide variety of data on the Web and elsewhere.

可扩展标记语言(XML)是一种源自SGML(ISO 8879)的简单,非常灵活的文本格式。 XML最初旨在应付大规模电子出版的挑战,但在Web和其他地方交换各种数据方面也起着越来越重要的作用。

  • XML stands for eXtensible Markup Language
    XML代表可扩展标记语言
  • XML is a markup language much like HTML
    XML是类似于HTML的标记语言
  • XML was designed to store and transport data
    XML旨在存储和传输数据
  • XML was designed to be self-descriptive
    XML被设计为可自我描述的

7. YAML:YAML不是标记语言 (7. YAML: YAML Ain't Markup Language)

YAML is a human friendly data serialization standard for all programming languages. It is commonly used for configuration files and in applications where data is being stored or transmitted.

YAML是适用于所有编程语言的人类友好数据序列化标准。 它通常用于配置文件和用于存储或传输数据的应用程序。

8.逗号分隔值(CSV)文件 (8. Comma-Separated Values (CSV) Files)

The comma separated values format (CSV) has been used for exchangingand converting data between various spreadsheet programs for quitesome time. Surprisingly, while this format is very common, it hasnever been formally documented. Additionally, while the IANA MIMEregistration tree includes a registration for "text/tab-separated-values" type, no MIME types have ever been registered with IANA for CSV. At the same time, various programs and operating systems have begun to use different MIME types for this format.

逗号分隔值格式(CSV)已在相当长的一段时间内用于在各种电子表格程序之间交换和转换数据。 令人惊讶的是,尽管这种格式非常普遍,但从未正式记录过。 此外,虽然IANA MIMEregistration树包含“文本/制表符分隔值”类型的注册,但尚未向IANA注册CSV的MIME类型。 同时,各种程序和操作系统已开始对此格式使用不同的MIME类型。

9. HTML (API文档) (9. HTML (API docs))

HTML stands for Hyper Text Markup Language

HTML代表H yper T外部中号 arkup 大号 anguage

— — —

— — —

这是您可能感兴趣的我的文章; (Here’s my articles which might interest you;)

Learn How Computer Works and What is Binary in 2 minutes

在2分钟内了解计算机的工作原理和什么是二进制

JWT Authentication and Refresh Token to API Platform

JWT身份验证和API平台的刷新令牌

Symfony Search Engine with Elasticsearch

带有Elasticsearch的Symfony搜索引擎

Testing Benford’s Law on Symfony 5, Php Framework

测试有关Symfony 5,PHP框架的本福德定律

翻译自: https://medium.com/swlh/formats-supported-by-the-api-platform-35013626c79f

http://www.taodudu.cc/news/show-6478765.html

相关文章:

  • PaperWeekly 第32期 | 基于知识图谱的问答系统关键技术研究 #01
  • 一个基于图的数据管理系统-gStore
  • 关联数据库中多张表_关联数据
  • KBRD:Towards Knowledge-Based Recommender Dialog System(迈向基于知识的推荐对话系统)
  • 知识图谱的系统工程观(综述)
  • 详解:多模态知识图谱种类及其应用
  • PaperWeekly 第32期 | 基于知识图谱的问答系统关键技术研究 01
  • CRSLab:构建会话推荐系统的开源工具包
  • 常见分辨率和码率对应关系
  • mesh导出OBJ、STL格式和win窗口调用
  • Unity导入STL格式模型(一)
  • 项目管理之:CMMI规范风险管理(RSKM)
  • 用Python的turtle库画太极图
  • 用turtle库画旋转太极图
  • 计算机二进制和太极,关于太极思维与二进制在什么地方可以找到更详细一点的资料?...
  • 太极阳必须要root吗_root手机教程
  • 失眠的原因各有不同,如何提升睡眠质量?
  • 改善睡眠小技巧
  • 睡眠与健康
  • 【操作系统经典问题】睡眠理发师问题
  • Mac 睡眠唤醒 不睡眠 问题
  • 解决win7无法进入睡眠状态的问题
  • 能够帮助睡眠的东西,这些东西能改善你的睡眠质量
  • 解读睡眠
  • 如何缓解睡眠障碍?9个方法助你快速入睡
  • 睡眠问题,转自刘品
  • 我是如何改善我的睡眠的?
  • 睡眠和休眠:常见问题
  • 以前听不懂的歌词如今都成了共鸣
  • 用歌词来记录此时的心情

api平台支持的格式相关推荐

  1. api格式_api平台支持的格式

    api格式 The API system has built-in content negotiation capabilities. By default, only the JSON-LD for ...

  2. 全球首发!老子云支持三维格式多达66种,可解决95%模型展示难题

    经常在网上看到3D模型师吐槽,被模型格式折磨得可太惨了. 因为3D模型大部分都是格式各异,数据信息无法互联互通,一个个手工处理至统一格式又十分耗时耗力,有时还无法达到预期效果. 老子云为了打破这一技术 ...

  3. 用 nginx 代理 MailChimp API 并支持跨域

    tl;dr nginx 既灵活方便,又功能丰富,可以帮助我们实现添加跨域头.URL 重写以及隐藏敏感信息等功能.本文介绍在使用 MailChimp 进行邮件营销中遇到的一个普遍问题,分析了浏览器发起跨 ...

  4. MTK平台 Android11 支持exFat格式T卡

    最近项目中想在MTK 的Android11版本中增加支持exfat格式的t卡,参考了CSDN上的几个博客的方法,成功实现了该功能. 因为几个博客的kernel和external 的代码的版本都各有不同 ...

  5. Instagram API平台文档

    目录 Authentication(认证方式) Do you need to authenticate?(您需要认证吗) Receiving an access_token(接收一个access_to ...

  6. Cocos Creator 3D v1.0.2 正式发布,新增小游戏平台支持

    ​Hi,各位开发者,Cocos Creator 3D 为大家带来翘首以待的新平台和新功能支持,v1.0.2 已正式发布,欢迎大家移步官网下载使用! 升级之前请根据项目情况进行必要的技术评估和版本备份噢 ...

  7. api平台通用签名机制

    通用API平台需要对每一个访问请求进行身份验证. 借鉴阿里云的SDK. 用户机制 API平台里的每一个用户有自己的uid. 每一个用户可以有一个或者多个appKey和appSecret.即一组appK ...

  8. 十大 API 平台网站分享(包括常用的API 大全整理)

    一.AWS API Gateway 是亚马逊云服务中的API管理平台,可以快速创建.发布和管理API,并提供可扩展的后端服务. 二.Google Cloud Endpoints 是Google Clo ...

  9. api.php t.cn,PHP通过调用新浪API生成t.cn格式短网址链接的方法详解

    本文实例讲述了PHP通过调用新浪API生成t.cn格式短网址链接的方法.分享给大家供大家参考,具体如下: 新浪提供了长链接转为短链接的API,可以把长链接转为 t.cn/xxx 这种格式的短链接. A ...

最新文章

  1. Exchange2003-2010迁移系列之四,配置第一台Exchange CAS/HUB服务器
  2. 大苏州战略:“北上”滨江?
  3. PhpStrom 常用的插件
  4. CopyOnWrite容器
  5. 让Eclipse变得快点,取消validation
  6. 中国象棋程序的设计与实现(五)--回答CSDN读者的一些问题
  7. http中url的长度限制
  8. 苹果应用商店审核_苹果应用商店AppStore审核规则指南
  9. 阿里巴巴中国站搜索店铺列表 API
  10. 什么是「重置SMC、NVRAM、PRAM」?看完这篇文章你就懂了!
  11. 图解WordPress怎么安装主题(三种方式)
  12. 计算机每年学硕和专硕数量,重磅:2019年研究生招生数据报告,专硕报考人数超过学硕?...
  13. Low-complexity Point Cloud Filtering for LiDAR by PCA-based Dimension Reduction
  14. 【笔记】因子投资:方法与实践
  15. LeetCode 576 出界的路经数
  16. AbMole科研-THZ1通过抑制自噬增强Sirolimus诱导的细胞毒性
  17. [JavaScript 刷题] 树 - 完全二叉树的节点个数, leetcode 222
  18. 基于SSM和Boostrap实现的电影评论网站设计 毕业论文+外文翻译及原文+项目源码
  19. Lyapunov-Krasovskii泛函二重积分项求导_原理
  20. linux个端口多个ip地址,linux 一个网口多个ip

热门文章

  1. 达梦的异构数据库同步软件DMHS的简单安装
  2. 2021赣一中高考成绩查询,2021江西省十大重点高中排名
  3. 这才是真正意义上的微博互粉工具
  4. 提高我们微博互粉的效率,使用一键关注Chrome扩展程序
  5. python绘图 添加文字_Python | 将文字添加到绘图中
  6. 2021科大讯飞-X光安检图像识别赛Top1方案!
  7. 网络安全怎么学?20年白帽子老江湖告诉你
  8. 企业信息化:创新需要偏执狂
  9. 解决方案:Windows DNS服务器未响应
  10. 【Win10】如何把你常用的软件工具放在Win10开始菜单的磁贴位置?