Basically I have this xml element (xml.etree.ElementTree) and I want to POST it to a url. Currently I'm doing something like
xml_string = xml.etree.ElementTree.tostring(my_element)
data = urllib.urlencode({'xml': xml_string})
response = urllib2.urlopen(url, data)
I'm pretty sure that works and all, but was wondering if there is some better practice or way to do it without converting it to a string first.
Thanks!