title: Python requests - extracting data from response.text
body: <p>I have been looking around for a few days now and cannot figure this out. Basically I'm uploading an image to a server and get an ID in return, the problem is I cannot figure out how to extract this ID and change it into a String ready to be saved into a database.</p>
  
  <p>Program Code</p>
  
  <pre><code>url = &lt;Server address&gt;
  with open("image.jpg", "rb") as image_file:
      files = {'file': image_file}
      auth = ('&lt;Key&gt;', '&lt;Pass&gt;')
      r = requests.post(url, files=files, auth=auth)
  
  data = r.json()
  uploaded = data.get('uploaded')
  content_id = uploaded[0]
  
  
  print r
  print r.text
  print '--------------'
  print str(content_id)
  </code></pre>
  
  <p>And here is the output I get</p>
  
  <pre><code>&lt;Response [200]&gt;
  {
      "status": "success",
      "uploaded": [
          {
              "filename": "image.jpg",
              "id": "6476edfa1d262ad81181d992da78149d"
          }
       ]
  }
  
  --------------
  {u'id': u'6476edfa1d262ad81181d992da78149d', u'filename': u'image.jpg'}
  </code></pre>