首页 > 解决方案 > 如何修复我的 json 格式以便我的服务器接受它?

问题描述

我的 json 服务器不允许我加载到本地主机。我将它放入格式化程序中,它指向各种语法问题。这是一个示例。我只是不明白。什么是正确的格式?出于某种原因,UserId:1 是唯一一个单独工作的。编辑:我这样做是为了可以使用 GET REQUEST 并将所有这些元素转换为对象。

{
Leaders:[
  {
    "UserId": 1,
    "Id": 1,
    "Title": "Life",
    "Body": "Man suffers only because he takes seriously what the gods made for fun."
  }
  {
    "UserId": 1,
    "Id": 2,
    "Title": "Nature",
    "Body": “Without birth and death, and without the perpetual transmutation of all the forms of life, the world would be static, rhythm-less, undancing, mummified.”
  }
  {
    "UserId": 1,
    "Id": 3;
    "Title": "Faith"
    "Body": "To have faith is to trust yourself to the water. When you swim you don’t grab hold of the water, because if you do you will sink and drown. Instead you relax, and float."
  }
  {
    "UserId": 1,
    "Id": 4;
    "Title": "Change",
    "Body": "The more a thing tends to be permanent, the more it tends to be lifeless."
  }
  {
    "UserId": 1,
    "Id": 5,
    "Title": "Contrast",
    "Body": "Things are as they are. Looking out into the universe at night, we make no comparisons between right and wrong stars, nor between well and badly arranged constellations."
  }
 ]
}

标签: jsonobjectserverformatlocalhost

解决方案


推荐阅读