title: Write curl in python code
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/2667509/curl-alternative-in-python">CURL alternative in Python</a>  </p>
  </blockquote>
  
  
  
  <p>I'm trying to write a python snippet that returns a JSON response. With curl it works and look like this:</p>
  
  <pre><code>curl -H 'content-type: application/json' \
       -d '' http://example.com/postservice.get_notes
  </code></pre>
  
  <p>How could I write code in python that returns a JSON object as the curl command does? </p>