Hi, I am currently writing a program that sends a HTTP get to a server and along with the HTTP response, the server sends me a XML file. What I am trying to do is to save this file. However i encountered the problem whereby the whole response message is saved. Below is an example of what was saved in the file.
<XML>....<info></info>...</XML>System.Threading.ThreadABortException:Thread was being aborted. at System.Threading. Thread.Abort(object stateinfo) at System Web. HttpResponse.End()at......
The code i used is:
Can anyone help me to either save the xml without the rest of the HTTP response msg or teach me how to retrieve the data for the element info. When I tried to real xml, I encountered error due to the unwanted information in the xml file.
status1, reason1, read1 = post_multipart(host, selector, fields, files)
if status1 > 0:
f = file(path_xml, 'wb')
appuifw.note(u"Query response received", "info")
doc = ET(file=path_xml)
#find the "path" element by tag name
body = doc.getroot().findall("info")
download_path = body.text
I tried google and search but could get no answer. So pls someone help me out