title: Curl POST into pycurl code
body: <p>I'm trying to convert following curl request into pycurl:</p>
  
  <pre><code>curl -v \
  --user username:passwd \
  -H X-Requested-By:MyClient \
  -H Accept:application/json \
  -X POST \
  http://localhost:7001/some_context
  </code></pre>
  
  <p>And it works. The following doesn't work:</p>
  
  <pre><code>import pycurl, json
  
  url = "http://localhost:7001/some_context"
  c = pycurl.Curl()
  data = json.dumps(None)
  c.setopt(pycurl.POST, 1)
  c.setopt(pycurl.POSTFIELDS, data)
  c.setopt(pycurl.URL, url)
  c.setopt(pycurl.HTTPHEADER, ['Accept: application/json', 'X-Requested-By:MyClient'])
  c.setopt(pycurl.VERBOSE, 1)
  c.setopt(pycurl.USERPWD, "username:passwd")
  c.perform()
  </code></pre>
  
  <p>But executing this I have an error 415: Unsupported media type. Do you have any idea? I would rather stay with pycurl- I know about requests library...</p>