title: Convert string to JSON in Python?
body: <p>I'm trying to convert a string, generated from an http request with urllib3.</p>
  
  <pre><code>Traceback (most recent call last):
    File "&lt;pyshell#16&gt;", line 1, in &lt;module&gt;
      data = json.load(data)
    File "C:\Python27\Lib\json\__init__.py", line 286, in load
      return loads(fp.read(),
  AttributeError: 'str' object has no attribute 'read'
  
  &gt;&gt;&gt; import urllib3
  &gt;&gt;&gt; import json
  &gt;&gt;&gt; request = #urllib3.request(method, url, fields=parameters)
  &gt;&gt;&gt; data = request.data
  </code></pre>
  
  <p>Now... When trying the following, I get that error...</p>
  
  <pre><code>&gt;&gt;&gt; json.load(data) # generates the error
  &gt;&gt;&gt; json.load(request.read()) # generates the error
  </code></pre>
  
  <p>Running <code>type(data)</code> and <code>type(data.read())</code> both return <code>&lt;type 'str'&gt;</code></p>
  
  <pre><code>data = '{"subscriber":"0"}}\n'
  </code></pre>