JSON 数据示例:对象、数组和嵌套结构
JSON(JavaScript 对象表示法)是一种轻量级的数据交换格式,广泛用于 Web 应用和 API 通信。以下是一些 JSON 数据示例,展示了不同的数据结构。
- 单个对象:
{
'name': 'John Doe',
'age': 30,
'email': 'johndoe@example.com'
}
- 数组对象:
[
{
'name': 'John Doe',
'age': 30,
'email': 'johndoe@example.com'
},
{
'name': 'Jane Smith',
'age': 25,
'email': 'janesmith@example.com'
}
]
- 嵌套对象:
{
'name': 'John Doe',
'age': 30,
'email': 'johndoe@example.com',
'address': {
'street': '123 Main St',
'city': 'New York',
'state': 'NY'
}
}
这些示例展示了 JSON 数据的基本结构,你可以根据这些示例创建自己的 JSON 数据,并根据你的需求进行调整。
原文地址: http://www.cveoy.top/t/topic/RNM 著作权归作者所有。请勿转载和采集!