how to return json response in flask
from flask import jsonify
@app.route('/summary')
def summary():
d = make_summary()
return jsonify(d)
how to return json response in flask
from flask import jsonify
@app.route('/summary')
def summary():
d = make_summary()
return jsonify(d)
get post request data flask
@app.route('/form-example', methods=['GET', 'POST']) #allow both GET and POST requests
def form_example():
if request.method == 'POST': #this block is only entered when the form is submitted
language = request.form.get('language')
framework = request.form['framework']
return '''<h1>The language value is: {}</h1>
<h1>The framework value is: {}</h1>'''.format(language, framework)
return '''<form method="POST">
Language: <input type="text" name="language"><br>
Framework: <input type="text" name="framework"><br>
<input type="submit" value="Submit"><br>
</form>'''
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us