Despite looking at URL building howtos with Flask, I couldn't figure out a way to keep form data in url.
This code works fine :
@app.route('/', methods=['GET'])
def index():
res = '''<form action="/search" method=post>
<p><input type="text" name="query" value="test"></p>
<p><input type="submit" value="Search"></p>
<br />
</form>'''
return res
@app.route('/search', methods=['POST'])
def search():
return request.form['query']
But results are displayed on myapp.com/search
while I would like something like myapp.com/search?query=toto
I must have missed something pretty basic I guess... Any hint ?
Thanks in advance