I have my Flask routes defined like so:
# main.py
from flask import Blueprint, request
main = Blueprint('main',__name__)
@main.route("/")
def hello():
return "Hello World!"
@main.route("/keke/")
def keke():
return "Hello Keke!"
@main.route("/upload/", methods=['POST'])
def upload():
if request.json:
return request.json
The upload
route receives a JSON that is posted. I would like to return that JSON back so I can check that the contents arrived at the server OK. However the line return request.json
throws the error TypeError: 'dict' object is not callable
. How would I go about doing this?