0
Below is my default.py where I set the end-point; What I’m trying to do is get the information from FORM that’s on "/" send to the return_request() and append the result of 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')
Yes, in my code is indented good. is that I’m getting used to using Stackoverflow
– Cristopher Gollmann
@Cristophergollmann understand, so what error occurs exactly? /output is displaying empty or 404?
– Guilherme Nascimento
then is that so, what I want to know is how I send the imput from FORM to the function return_request() and then how I get the return of that function and show in /output
– Cristopher Gollmann