烧瓶的简单响应实用程序

Flask-Responses的Python项目详细描述


烧瓶响应0.2
===


…图片::https://pypip.in/version/flask responses/badge.svg
:目标:https://pypi.python.org/pypi/flask responses/
:alt:latest version

…图片::https://secure.travis-ci.org/parkayun/flask-responses.svg?branch=master
:alt:build status
:target:https://travis ci.org/parkayun/flask responses

。图片::https://img.shields.io/coveralls/parkayun/flask responses.svg
:alt:coverage status
:target:https://coveralls.io/r/parkayun/flask responses

module::flask.ext.responses

“flask”的简单响应实用程序。_烧瓶:http://flask.pocoo.org/

sourcecode::bash

~$python setup.py install


,或者可以使用pip

。源代码::bash

~$pip install flask responses


快速启动
----

…sourcecode::python

from flask import flask
from flask.ext.responses导入json嫒response、xml嫒response、auto嫒response

def hello():
return json嫒response({“消息”:“你好,世界!”},status_code=201)

@app.route(“/xml”)
def world():
返回xml_响应({“消息”:“你好,世界!”},headers={'x-foo':'bar'})或者可以执行XML响应('<;message>;hello world<;message>;')

@app.route(“/auto”)
def auto():
返回自动响应({“message”:“hello world!”},状态代码=201,头={'x-foo':'bar'})


响应
----
*json(json-response)
*xml(xml-response)

标签:

  • https
  • org
  • 实用程序
  • json
  • flask
  • 烧瓶
  • response
  • xml
  • responses
  • 欢迎加入QQ群-->: 979659372 Python中文网_新手群

    推荐PyPI第三方库


    热门话题
    java如何使用Array和ArrayList做同样的事情?   用户界面使Java JScrollpane仅垂直滚动   查找字符串中最长的重复子字符串所需的算法Java函数?   java我想在listview中检索firebase数据   java如何使用Jsoup提取链接?   java 安卓。看法使用RTEditor时发生充气异常   maven为什么自动依赖是错误版本?(java.lang.ClassNotFoundException:org.junit.jupiter.api.MethodOrderContext)   使用apachespark进行java开发   java glDrawBuffers是否应该翻转IntBuffer?   java在添加回调之前完成CompletableFuture<T>   用Java构建搜索树   java将web应用程序部署到Heroku   active directory Java LDAP:属性为只读   启动Spring启动应用程序时未考虑java DB端口   使用Mockito的java模拟   C++从运行时运行java的过程。执行出口代码139   javascript使用脚本删除旧SonarQube项目   java代理每节点模型?   java无法在Android上通过Internet从PC服务器接收UDP数据   在bluemix:java上加载p12时发生ibm云错误。木卫一。IOException:数据不足