Skip to content
Myr

Linked HTTP

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Armin Ronacher · committed by Armin Ronacher · parent 85ca089 · Browse files · 1 file+11 added−8 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+11 added−8 removed

  • other:+11 added−8 removed

1 file+11 added−8 removed

modified:docs/quickstart.rst+11 added-8 removed
175 unmodified lines
176177HTTP Methods178````````````179180HTTP knows different methods to access URLs. By default a route only181answers to ``GET`` requests, but that can be changed by providing the182`methods` argument to the :meth:`~flask.Flask.route` decorator. Here some183examples::180HTTP (the protocol web applications are speaking) knows different methods181to access URLs. By default a route only answers to `GET` requests, but182that can be changed by providing the `methods` argument to the183:meth:`~flask.Flask.route` decorator. Here some examples::184185 @app.route('/login', methods=['GET', 'POST'])186 def login():187 if request.method == 'POST':188 do_the_login()189 else:190 show_the_login_form()191192If ``GET`` is present, ``HEAD`` will be added automatically for you. You193don't have to deal with that. It will also make sure that ``HEAD``194requests are handled like the RFC demands, so you can completely ignore195that part of the HTTP specification.192If `GET` is present, `HEAD` will be added automatically for you. You193don't have to deal with that. It will also make sure that `HEAD` requests194are handled like the `HTTP RFC`_ (the document describing the HTTP195protocol) demands, so you can completely ignore that part of the HTTP196specification.197198You have no idea what an HTTP method is? Worry not, here quick199introduction in HTTP methods and why they matter:200
39 unmodified lines
240HTTP became quite popular lately and there are more things than browsers241that are speaking HTTP. (Your revision control system for instance might242speak HTTP)243244.. _HTTP RFC: http://www.ietf.org/rfc/rfc2068.txt245246Static Files247------------248249Dynamic web applications need static files as well. That's usually where
342 unmodified lines