Posted By

jportillo on 07/02/06


Tagged

server python xml


Versions (?)

Who likes this?

3 people have marked this snippet as a favorite

ndegruchy
anayhk
taboularasa


get xml


 / Published in: Python
 

como respuesta a un GET, obtiene un recurso xml del URL que se le pasa como parámtero y lo devuelve

  1. def get_xml(self, remote_addr):
  2.  
  3. remote_file = urllib.urlopen(remote_addr)
  4. remote_data = remote_file.read()
  5. remote_file.close()
  6.  
  7. self.REQUEST.RESPONSE.setHeader('Content-Type', 'text/xml')
  8. return remote_data

Report this snippet  

You need to login to post a comment.