I want to call app.route method from another app.route method. As an example the code look like this simply. I want to call getMethod() function inside the postMethod() function. How can I do this?
@app.route('/ex1')
def getMethod():
return "some value"
@app.route('/ex2', methods=['POST'])
def postMethod():
# want to call getMethod() and get the return value
# save data to database
return jsonify('created'), 201