Below is my default.py where I define the end-points; What I'm trying to do is grab the FORM information that is in "/" send to return_request () and show the result of the Request in / output "
def return_request(endPoint):
headerInfo = {
'content-type': 'application/ld+json',
'X-API-KEY': '3feff58c-5302-49da-803e-25eb0a34dce5'
}
url = "..../"
res = requests.get(url + '%s' % (endPoint), headers=headerInfo)
return res
@app.route("/", methods=["GET", "POST"])
def index():
form = ReqForm()
if form.validate_on_submit():
form.reset()
else:
pass
return render_template('index.html', req=form)
@app.route("/output", methods=["GET", "POST"])
def output():
return render_template('output.html')