forked from orbit-oss/flask
Merge pull request #878 from shamrin/patch-1
quickstart: import `request` in HTTP methods example
This commit is contained in:
commit
caa0c00420
1 changed files with 2 additions and 0 deletions
|
|
@ -258,6 +258,8 @@ accessing URLs. By default, a route only answers to `GET` requests, but that
|
||||||
can be changed by providing the `methods` argument to the
|
can be changed by providing the `methods` argument to the
|
||||||
:meth:`~flask.Flask.route` decorator. Here are some examples::
|
:meth:`~flask.Flask.route` decorator. Here are some examples::
|
||||||
|
|
||||||
|
from flask import request
|
||||||
|
|
||||||
@app.route('/login', methods=['GET', 'POST'])
|
@app.route('/login', methods=['GET', 'POST'])
|
||||||
def login():
|
def login():
|
||||||
if request.method == 'POST':
|
if request.method == 'POST':
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue