title: Python: request with custom header fails
body: <p>I have some problems making a post request with a custom header.
  I'm using the <a href="http://docs.python-requests.org/en/master/" rel="nofollow noreferrer">Requests</a> library and as endpoint <a href="https://jsonplaceholder.typicode.com/" rel="nofollow noreferrer">jsonplaceholder</a>, where you can get for a POST request a fake JSON back.</p>
  
  <p>I call my script with </p>
  
  <pre><code>py request.py
  </code></pre>
  
  <p>// request.py</p>
  
  <pre><code>import requests
  import json
  from pprint import pprint
  
  def postReqCustom( url, headers, data):
      print('Making request to: ', url)
      r = requests.post(url, headers=headers, data=data)
  
      print('status code: ' + str(r.status_code))
  
      response = r.json()
      pprint(response)
  
  def postReq( url, data):
      print('Making request to: ', url)
      r = requests.post(url, data=data)
  
      print('status code: ' + str(r.status_code))
  
      response = r.json()
      pprint(response)
  
  headers = {'content-type': 'application/json'}
  
  data = {
              "title": "foo",
              "body": "bar",
              "userId": 1
              }
  post_url = "https://jsonplaceholder.typicode.com/posts"
  
  #postReq(post_url, data) #ok
  postReqCustom(post_url, headers, data) #error
  </code></pre>
  
  <p>For <code>postReq</code> I don't get any errors(status code 201) but when I try <code>postReqCustom</code> with a custom header I'm getting following error:</p>
  
  <pre><code>Making request to:  https://jsonplaceholder.typicode.com/posts
  status code: 500
  Traceback (most recent call last):
    File "request.py", line 55, in &lt;module&gt;
      postReqCustom(post_url, headers, payload)
    File "request.py", line 24, in postReqCustom
      response = r.json()
    File "C:\Users\Samy\AppData\Local\Programs\Python\Python36-32\lib\site-packages\requests\models.py", line 892, in json
      return complexjson.loads(self.text, **kwargs)
    File "C:\Users\Samy\AppData\Local\Programs\Python\Python36-32\lib\json\__init__.py", line 354, in loads
      return _default_decoder.decode(s)
    File "C:\Users\Samy\AppData\Local\Programs\Python\Python36-32\lib\json\decoder.py", line 339, in decode
      obj, end = self.raw_decode(s, idx=_w(s, 0).end())
    File "C:\Users\Samy\AppData\Local\Programs\Python\Python36-32\lib\json\decoder.py", line 357, in raw_decode
      raise JSONDecodeError("Expecting value", s, err.value) from None
  json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
  </code></pre>