代码之家  ›  专栏  ›  技术社区  ›  Tauquir

如何在瓶子中发送XML/应用程序格式?

  •  4
  • Tauquir  · 技术社区  · 14 年前

    如果有人访问我的URL,假设/获取它应该在瓶子框架中返回XML/应用程序格式作为响应。我该怎么做?我使用elementree作为XML生成器。

    1 回复  |  直到 14 年前
        1
  •  5
  •   Andre Bossard    14 年前

    看看 official page 对于cookie示例,请这样做:

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