烧瓶的简单响应实用程序
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
===
…图片::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
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)
标签: