forked from orbit-oss/flask
Add syntatic sugar for route registration
This takes a popular API whereby instead of passing the HTTP method as
an argument to route it is instead used as the method name i.e.
@app.route("/", methods=["POST"])
is now writeable as,
@app.post("/")
This is simply syntatic sugar, it doesn't do anything else, but makes
it slightly easier for users.
I've included all the methods that are relevant and aren't auto
generated i.e. not connect, head, options, and trace.
This commit is contained in:
parent
82d69cd06c
commit
705e52684a
3 changed files with 61 additions and 0 deletions
|
|
@ -64,6 +64,9 @@ Unreleased
|
|||
This could allow a session interface to change behavior based on
|
||||
``request.endpoint``. :issue:`3776`
|
||||
- Use Jinja's implementation of the ``|tojson`` filter. :issue:`3881`
|
||||
- Add route decorators for common HTTP methods. For example,
|
||||
``@app.post("/login")`` is a shortcut for
|
||||
``@app.route("/login", methods=["POST"])``. :pr:`3907`
|
||||
|
||||
|
||||
Version 1.1.2
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue