Python/Json:Expecting property name enclosed in double quotes

前端 未结 16 2325
南方客
南方客 2020-11-27 03:23

I\'ve been trying to figure out a good way to load JSON objects in Python. I send this json data:

{\'http://example.org/about\': {\'http://purl.org/dc/terms/         


        
16条回答
  •  -上瘾入骨i
    2020-11-27 03:27

    I've checked your JSON data

    {'http://example.org/about': {'http://purl.org/dc/terms/title': [{'type': 'literal', 'value': "Anna's Homepage"}]}}
    

    in http://jsonlint.com/ and the results were:

    Error: Parse error on line 1:
    {   'http://example.org/
    --^
    Expecting 'STRING', '}', got 'undefined'
    

    modifying it to the following string solve the JSON error:

    {
        "http://example.org/about": {
            "http://purl.org/dc/terms/title": [{
                "type": "literal",
                "value": "Anna's Homepage"
            }]
        }
    }
    

提交回复
热议问题