开发者

How to send xml/application format in bottle?

开发者 https://www.devze.com 2023-01-11 21:50 出处:网络
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 us开发者_如何学Going elementree as xml generator.Look on t

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 us开发者_如何学Going elementree as xml generator.


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
0

精彩评论

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