title: Giving error "the JSON object must be str, not 'bytes' "
body: <p>I was following a tutorial that how to use elasticsearch with python (link= 
    <a href="https://tryolabs.com/blog/2015/02/17/python-elasticsearch-first-steps/#contacto" rel="nofollow noreferrer">https://tryolabs.com/blog/2015/02/17/python-elasticsearch-first-steps/#contacto</a>) i faced this error.    </p>
  
  <pre><code>import json
      r = requests.get('http://localhost:9200') 
      i = 1
      while r.status_code == 200:
          r = requests.get('http://swapi.co/api/people/'+ str(i))
          es.index(index='sw', doc_type='people', id=i, body=json.loads(r.content))
          i=i+1
  
      print(i)
  </code></pre>
  
  <p>TypeError: the JSON object must be str, not 'bytes'</p>