Simple response utility for Flask.
Switch branches/tags
Nothing to show
Clone or download
Parkayun Merge pull request #14 from yangroro/master
README.rst: Fix broken pypi version image
Latest commit 631a2c2 Apr 12, 2017
Failed to load latest commit information.
flask_responses Fixed auto_response bug Jan 19, 2015
tests fix set header bug Jan 19, 2015
.travis.yml Update .travis.yml Jan 19, 2015
README.rst Fix broken version image Apr 11, 2017 update Jan 19, 2015


Flask-Responses 0.2

Latest Version Build Status Coverage Status
.. module:: flask.ext.responses

Simple response utility for Flask.


~ $ python install

or can use pip

~ $ pip install flask-responses

Quick start

from flask import Flask
from flask.ext.responses import json_response, xml_response, auto_response

app = Flask(__name__)

def hello():
    return json_response({"message": "Hello World!"}, status_code=201)

def world():
   # or can do this return xml_response('<message>Hello World</message>')
   return xml_response({"message": "Hello World!"}, headers={'x-foo': 'bar'})

def auto():
   # auto response json or xml by Accept request header
   return auto_response({"message": "Hello World!"}, status_code=201, headers={'x-foo': 'bar'})


  • JSON (json_response)
  • XML (xml_response)


  • allow origin cross domain
  • server sent events