开发者

Creating an xml file w/ google app engine

开发者 https://www.devze.com 2023-02-07 05:41 出处:网络
I m currently using db.Model to store a string (already in xml format) how do I make this xml string publicly accessible (in the form o开发者_JAVA技巧f example.appspot.com/xml_file so firefox will rec

I m currently using db.Model to store a string (already in xml format) how do I make this xml string publicly accessible (in the form o开发者_JAVA技巧f example.appspot.com/xml_file so firefox will recgonize it as xml or even of example.appspot.com) I see there is a function to_xml() but I dont know how to use it in such a way that firefox will recognize it as xml?? Thanks


Set the response content type to "text/xml".

If you're using GAE's webapp framework use this in the request handler:

self.response.headers['Content-Type'] = 'text/xml'

If you're using another framework, like Django, look up setting the content type in their docs.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号