title: Convert curl to Pycurl.
body: <p>I have this curl command and I would like to know if I have converted it   correctly to pycurl.</p>
  
  <p>curl command </p>
  
  <pre><code>curl -D- -u fred:fred -X PUT --data{see below} -H "Content-Type:application/json" http://kelpie9:8081/rest/api/2/issue/QA-31
  
  {
   "fields":
  {
  "assignee":{"name":"harry"}
  }
  }
  </code></pre>
  
  <p>python code</p>
  
  <pre><code>def assign(self, key, name):
  data = json.dumps({"fields":{"assignee":{"name":name}}}) 
  c= pycurl.Curl()
  c.setopt(pycurl.VERBOSE, 1)
  c.setopt(pycurl.URL, "http://xxx/rest/api/2/issue/"+ key )
  c.setopt(pycurl.HTTPHEADER, ['Content-Type: application/json', 'Accept: application/json'])
  c.setopt(pycurl.USERPWD, "****") 
  c.setopt(pycurl.PUT, 1) 
  c.setopt(pycurl.POSTFIELDS,data)
  c.perform(
  </code></pre>