Can't parse json file: json.decoder.JSONDecodeError: Extra data.

后端 未结 3 740
走了就别回头了
走了就别回头了 2020-12-20 03:56

I have a json file. A simplified version of it looks as following:

{
  \"host\": \"a.com\",
  \"ip\": \"1.2.2.3\",
  \"port\": 8
}
{
  \"host\":         


        
3条回答
  •  佛祖请我去吃肉
    2020-12-20 04:28

    Your JSON file isn't available in proper format.
    It should be like this, inside a list, comma separated:

    [
        {
         "host": "a.com",
         "ip": "1.2.2.3",
         "port": 8
        },
        {
         "host": "b.com",
         "ip": "2.5.0.4",
         "port": 3
    
        },
        {
         "host": "c.com",
         "ip": "9.17.6.7",
         "port": 4
        },
    ]
    

提交回复
热议问题