I have to POST a request to a server. In the API documentation of the website there is this example that uses cURL in PHP:
$ch = curl_init();
curl_setopt($ch
Taking your code, this should actually work.
import urllib
import urllib2
url = 'http://api.website.com/'
values = {'some_key':'some_value'}
data = urllib.urlencode(values)
req = urllib2.Request(url, data)
response = urllib2.urlopen(req)
page = response.read()
print page + '\n\n'
What is the error you are getting?