get requests method flask

Solutions on MaxInterview for get requests method flask by the best coders in the world

showing results for - "get requests method flask"
Jazmín
21 Sep 2016
1import flask
2app = flask.Flask('your_flask_env')
3
4@app.route('/register', methods=['GET', 'POST'])
5def register():
6    if flask.request.method == 'POST':
7        username = flask.request.values.get('user') # Your form's
8        password = flask.request.values.get('pass') # input names
9        your_register_routine(username, password)
10    else:
11        # You probably don't have args at this route with GET
12        # method, but if you do, you can access them like so:
13        yourarg = flask.request.args.get('argname')
14        your_register_template_rendering(yourarg)
15
Helena
14 Oct 2016
1if request.method == 'POST':
similar questions
queries leading to this page
get requests method flask