I have some PHP code, similar to that shown below, which makes a connection and gets a response (from a web-service).
How would I do something similar in Python?
$cObj = curl_init();.
curl_setopt($cObj, CURLOPT_URL,$this->urlws.'/trlink/link1/trlink');
curl_setopt($cObj, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($cObj, CURLOPT_TIMEOUT, 20);
curl_setopt($cObj, CURLOPT_HTTPHEADER, array());
curl_setopt($cObj, CURLOPT_POST, 1);
curl_setopt($cObj, CURLOPT_POSTFIELDS,"XMLString=".$xml);
$this->xml_response = curl_exec($cObj);.
You can try SUDS https://fedorahosted.org/suds/