Json杂谈之注意事项

2020-05-10  本文已影响0人  伍个一
为什么需要熟练掌握JSON数据格式?
在接口测试的时候,响应数据格式基本上为JSON和XML两种,且两者可以相互转换
比较有代表性的JWT (JSON Web Tokens)
key value
字符串a 字符串(必须用双引号)
字符串b 数字(整数最大15位,小数最大17位)
字符串c (不能重复,本质上还是按照JavaScript对象语法,对象内名称唯一) 数组
字符串d 布尔
字符串e 空值
字符串f json
{
  "squadName" : "Super hero squad",
  "homeTown" : "Metro City",
  "formed" : 2016,
  "secretBase" : "Super tower",
  "active" : true,
  "members" : [
    {
      "name" : "Molecule Man",
      "age" : 29,
      "secretIdentity" : "Dan Jukes",
      "powers" : [
        "Radiation resistance",
        "Turning tiny",
        "Radiation blast"
      ]
    },
    {
      "name" : "Madame Uppercut",
      "age" : 39,
      "secretIdentity" : "Jane Wilson",
      "powers" : [
        "Million tonne punch",
        "Damage resistance",
        "Superhuman reflexes"
      ]
    },
    {
      "name" : "Eternal Flame",
      "age" : 1000000,
      "secretIdentity" : "Unknown",
      "powers" : [
        "Immortality",
        "Heat Immunity",
        "Inferno",
        "Teleportation",
        "Interdimensional travel"
      ]
    }
  ]
}
上一篇下一篇

猜你喜欢

热点阅读