from flask import Flask, request
app = Flask(__name__)
@app.route('/post/', methods=['GET', 'POST'])
def update_post():
# show the post with the given id, the id is an integer
postId = request.args.get('postId')
uid = request.args.get('uid')
return postId, uid
def getpostidanduid():
with app.app_context():
credsfromUI = update_post()
app.logger.message("The postId is %s and uid is %s" %(request.args.get('postId'), request.args.get('uid')))
## Prints 'The post id is red and uid is blue'\
return credsfromUI
print(getpostidanduid())
if __name__ == '__main__':
# This is used when running locally. Gunicorn is used …
Run Code Online (Sandbox Code Playgroud)