Python/Json:Expecting property name enclosed in double quotes
<p>I've been trying to figure out a good way to load JSON objects in Python.
I send this json data:</p>

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

<p>to the backend where it will be received as a string then I used <code>json.loads(data)</code> to parse it.</p>

<p>But each time I got the same exception : </p>

<pre><code>ValueError: Expecting property name enclosed in double quotes: line 1 column 2 (char 1)
</code></pre>

<p>I googled it but nothing seems to work besides this solution <code>json.loads(json.dumps(data))</code> which personally seems for me not that efficient since it accept any kind of data even the ones that are not in json format.</p>

<p>Any suggestions will be much appreciated.</p>

<p>I've checked your JSON data </p>

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

<p>in <a href="http://jsonlint.com/" rel="nofollow">http://jsonlint.com/</a> and the results were:</p>

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

<p>modifying it to the following string solve the JSON error:</p>

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

python json parsing