aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin/tools/response.py
diff options
context:
space:
mode:
authorxray7224 <jessica@megworld.co.uk>2013-07-11 17:58:58 +0100
committerxray7224 <jessica@megworld.co.uk>2013-07-11 18:21:43 +0100
commit2b60a56cbec44f789ee2efe71294979d7784515c (patch)
treecf2476a7301fa71d18385ace757c2633cf8d7f82 /mediagoblin/tools/response.py
parent405aa45adc14d3c67a120618ecc0ae792f5881de (diff)
downloadmediagoblin-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.py19
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