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
Consider using a packet sniffer to figure out if cURL is sending User-Agent information. If it is, and the service is expecting that information, then use the add_header() method on your Request (from urllib2 documentation, bottom of page):
import urllib2
req = urllib2.Request('http://api.website.com/')
# Your parameter encoding here
req.add_header('User-agent', 'Mozilla/5.0')
r = urllib2.urlopen(req)
# Process the response