from flask import Flask, request
app = Flask(__name__)
@app.route('/', methods=['GET', 'POST'])
def index():
data = request.form['input_name'] # pass the form field name as key
...
from flask import Flask,url_for,request
''' html form:
<form action="{{ url_for('posted')}}" method="post">
<input id="post" placeholder="enter post" type="text" name="post">
<button type="submit">submit</button>
</form>
'''
@app.route('/posted', methods=['POST'])
def posted():
data = request.form['post']
return '<h1>'+data+'</h1>'