diff options
author | xray7224 <jessica@megworld.co.uk> | 2013-07-11 17:58:58 +0100 |
---|---|---|
committer | xray7224 <jessica@megworld.co.uk> | 2013-07-11 18:21:43 +0100 |
commit | 2b60a56cbec44f789ee2efe71294979d7784515c (patch) | |
tree | cf2476a7301fa71d18385ace757c2633cf8d7f82 /mediagoblin/tools/response.py | |
parent | 405aa45adc14d3c67a120618ecc0ae792f5881de (diff) | |
download | mediagoblin-2b60a56cbec44f789ee2efe71294979d7784515c.tar.lz mediagoblin-2b60a56cbec44f789ee2efe71294979d7784515c.tar.xz mediagoblin-2b60a56cbec44f789ee2efe71294979d7784515c.zip |
Finishes most of oauth, just decorator to complete
Diffstat (limited to 'mediagoblin/tools/response.py')
-rw-r--r-- | mediagoblin/tools/response.py | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/mediagoblin/tools/response.py b/mediagoblin/tools/response.py index db8fc388..b0401e08 100644 --- a/mediagoblin/tools/response.py +++ b/mediagoblin/tools/response.py @@ -138,3 +138,22 @@ def json_response(serializable, _disable_cors=False, *args, **kw): response.headers.set(key, value) return response + +def form_response(data, *args, **kwargs): + """ + Responds using application/x-www-form-urlencoded and returns a werkzeug + Response object with the data argument as the body + and 'application/x-www-form-urlencoded' as the Content-Type. + + Any extra arguments and keyword arguments are passed to the + Response.__init__ method. + """ + + response = wz_Response( + data, + content_type="application/x-www-form-urlencoded", + *args, + **kwargs + ) + + return response |