Skip to content

Commit d8ac448

Browse files
Jose Bogarín Solanocmlccie
authored andcommitted
Fixed bug in bot-example-flash.py. Changed request.data to request.json (#35)
Correction to `bot-example-flask.py` to ensure Python v2 & v3 compatibility.
1 parent b74d574 commit d8ac448

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

examples/bot-example-flask.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
# -*- coding: utf-8 -*-
33
"""A simple bot script, built on Flask.
44
5-
This sample script leverages the Flask web service micro-framework
6-
(see http://flask.pocoo.org/). By default the web server will be reachable at
7-
port 5000 you can change this default if desired (see `flask_app.run(...)`).
5+
This sample script leverages the Flask web service micro-framework
6+
(see http://flask.pocoo.org/). By default the web server will be reachable at
7+
port 5000 you can change this default if desired (see `flask_app.run(...)`).
88
9-
ngrok (https://ngrok.com/) can be used to tunnel traffic back to your server
9+
ngrok (https://ngrok.com/) can be used to tunnel traffic back to your server
1010
if your machine sits behind a firewall.
1111
1212
You must create a Spark webhook that points to the URL where this script is
@@ -88,7 +88,7 @@ def sparkwebhook():
8888
elif request.method == 'POST':
8989
"""Respond to inbound webhook JSON HTTP POST from Cisco Spark."""
9090

91-
json_data = request.data # Get the POST data sent from Cisco Spark
91+
json_data = request.json # Get the POST data sent from Cisco Spark
9292
print("\n")
9393
print("WEBHOOK POST RECEIVED:")
9494
print(json_data)

0 commit comments

Comments
 (0)