title: Sending POST request to a webservice from python
body: <p>I'm trying to send a POST request to a restful webservice. I need to pass some <code>json</code> in the request.It works with the curl command below</p>
  
  <pre><code>curl --basic -i --data '&lt;json data string here&gt;' -H Content-type:"text/plain" -X POST http://www.test.com/api
  </code></pre>
  
  <p>I need some help in making the above request from Python. To send this POST request from python I have the following code so far:</p>
  
  <pre><code>import urllib
  url='http://www.test.com/api'
  params = urllib.urlencode... #What should be here ?
  data = urllib.urlopen(url, params).read()
  </code></pre>
  
  <p>I have the following three questions:</p>
  
  <ol>
  <li>Is this the correct way to send the resuest ?. </li>
  <li>How should i specify the params value ?</li>
  <li>Does content-type need to be specified ?</li>
  </ol>
  
  <p>Please Help
  Thank You</p>