I have the following simple Python code that makes a simple post request to a REST service -
params= { "param1" : param1,
"param2" : param2,
"param3" : param3 }
xmlResults = urllib.urlopen(MY_APP_PATH, urllib.urlencode(params)).read()
results = MyResponseParser.parse(xmlResults)
The problem is that the url used to call the REST service will now require basic authentication (username and password). How can I incorporate a username and password / basic authentication into this code, as simply as possible?