Get form data from Flask's request object:
from flask import Flask, request
app = Flask(__name__)
@app.route('/', methods=['GET', 'POST'])
def index():
data = request.form['input_name']
...
You can also set a default value to avoid 400 error, like this:
from flask import Flask, request
app = Flask(__name__)
@app.route('/', methods=['GET', 'POST'])
def index():
default_name = '0'
data = request.form.get('input_name', default_name)
...