Diff

mod_rest/example/app.py @ 3861:ede3d1724dd1

mod_rest: Attempt to auto-discover data type wanted by callback
author Kim Alvefur <zash@zash.se>
date Sat, 25 Jan 2020 20:04:39 +0100
parent 3854:25c34c9f755c
child 3863:45b04f05d624
line wrap: on
line diff
--- a/mod_rest/example/app.py	Sat Jan 25 02:06:07 2020 +0100
+++ b/mod_rest/example/app.py	Sat Jan 25 20:04:39 2020 +0100
@@ -3,6 +3,11 @@
 app = Flask("echobot")
 
 
+@app.route("/api", methods=["OPTIONS"])
+def options():
+    return Response(status=200, headers={"accept": "application/json"})
+
+
 @app.route("/api", methods=["POST"])
 def hello():
     print(request.data)