Answers for "flask get data"

1

posted data to flask

from flask import Flask, request, jsonify

app = Flask(__name__)

@app.route('/post')
def post():
    res = request.json
    return jsonify(res)
  
app.run()
Posted by: Guest on May-05-2021
5

get request body flask

request.args: the key/value pairs in the URL query string
request.form: the key/value pairs in the body, from a HTML post form, or JavaScript request that isn't JSON encoded
request.files: the files in the body, which Flask keeps separate from form. HTML forms must use enctype=multipart/form-data or files will not be uploaded.
request.values: combined args and form, preferring args if keys overlap
request.json: parsed JSON data. The request must have the application/json content type, or use request.get_json(force=True) to ignore the content type.
Posted by: Guest on May-31-2020

Python Answers by Framework

Browse Popular Code Answers by Language