如何在瓶子中发送xml/应用程序格式? [英] How to send xml/application format in bottle?

查看:38
本文介绍了如何在瓶子中发送xml/应用程序格式?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果有人到达我的网址,则假设/get应当以Bottle框架的形式返回xml/应用程序格式.我怎样才能做到这一点?我正在使用elementree作为xml生成器.

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.

推荐答案

官方页面中查找Cookie示例,并按以下步骤操作:

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

这篇关于如何在瓶子中发送xml/应用程序格式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆