How to send xml/application format in bottle?

允我心安 提交于 2019-12-22 09:09:10

问题


If some one come to my url suppose /get it should give back a xml/application format in response in bottle framework. How can i do this? i am using elementree as xml generator.


回答1:


Look on the official page for the cookie example and do it like this:

@route('/xml')
def xml():
    response.headers['Content-Type'] = 'xml/application'
    ....(create the xml here)......
    return xml_content_whatever


来源:https://stackoverflow.com/questions/3490744/how-to-send-xml-application-format-in-bottle

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!