title: json decoding of POST request failing in python
body: <p>this error has been discussed in many threads and i tried all those before posting this question! none of them are solving my problem and i continue to get the same error. however the same url when opened in browser it does return a valid json response. only in my python code its failing.</p>
  
  <p>so here is my code,</p>
  
  <pre><code>url = 'https://&lt;some-site-name&gt;'
  
  headers = {'some headers'}
  
  payload = {'some payload'}
  
  req = requests.post(url, data=payload, headers=headers)
  
  print(req.json()) **-&gt; errors appears on this line**
  </code></pre>
  
  <p>below is detailed error log,</p>
  
  <pre><code>Traceback (most recent call last):
  File "/home/ssh/testcode/kpp_login.py", line 142, in &lt;module&gt;
  print(req.json())
  
  File "/home/ssh/.local/lib/python2.7/site-packages/requests/models.py",     line 896, in json
  return complexjson.loads(self.text, **kwargs)
  
  File "//home/ssh/.local/lib/python2.7/site-packages/simplejson /__init__.py",  line 518, in loads
  return _default_decoder.decode(s)
  
  File "/home/ssh/.local/lib/python2.7/site-packages/simplejson/decoder.py", line 370, in decode
  obj, end = self.raw_decode(s)
  
  File "/home/ssh/.local/lib/python2.7/site-packages/simplejson/decoder.py", line 400, in raw_decode
  
  return self.scan_once(s, idx=_w(s, idx).end())
  
  JSONDecodeError: Expecting value: line 1 column 1 (char 0)
  </code></pre>