Update app.py
Browse files
app.py
CHANGED
@@ -1,9 +1,12 @@
|
|
1 |
from flask import Flask, request
|
2 |
-
|
3 |
|
4 |
@app.route('/json_example', methods=['POST'])
|
5 |
def handle_json():
|
6 |
data = request.json
|
7 |
print(data.get('name'))
|
8 |
print(data.get('age'))
|
9 |
-
return data
|
|
|
|
|
|
|
|
1 |
from flask import Flask, request
|
2 |
+
app = Flask(__name__)
|
3 |
|
4 |
@app.route('/json_example', methods=['POST'])
|
5 |
def handle_json():
|
6 |
data = request.json
|
7 |
print(data.get('name'))
|
8 |
print(data.get('age'))
|
9 |
+
return data
|
10 |
+
|
11 |
+
if __name__ == '__main__':
|
12 |
+
app.run()
|