From 29df274442355e64e991892d2f2b7a65a19054d3 Mon Sep 17 00:00:00 2001 From: Alexandru Mihai <92.alexandru.mihai@gmail.com> Date: Sat, 23 Jul 2016 16:59:59 +0200 Subject: [PATCH] Added documentation for shortcut methods on router --- docs/web_reference.rst | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/docs/web_reference.rst b/docs/web_reference.rst index 79368a98f73..25a4d8bb9bd 100644 --- a/docs/web_reference.rst +++ b/docs/web_reference.rst @@ -1202,6 +1202,31 @@ Router is any object that implements :class:`AbstractRouter` interface. :returns: new :class:`PlainRoute` or :class:`DynamicRoute` instance. + .. method:: add_get(path, *args, **kwargs) + + Shortcut for adding a GET handler. Calls the :meth:`add_route` with \ + ``method`` equals to ``'GET'``. + + .. method:: add_post(path, *args, **kwargs) + + Shortcut for adding a POST handler. Calls the :meth:`add_route` with \ + ``method`` equals to ``'POST'``. + + .. method:: add_put(path, *args, **kwargs) + + Shortcut for adding a PUT handler. Calls the :meth:`add_route` with \ + ``method`` equals to ``'PUT'``. + + .. method:: add_patch(path, *args, **kwargs) + + Shortcut for adding a PATCH handler. Calls the :meth:`add_route` with \ + ``method`` equals to ``'PATCH'``. + + .. method:: add_delete(path, *args, **kwargs) + + Shortcut for adding a DELETE handler. Calls the :meth:`add_route` with \ + ``method`` equals to ``'DELETE'``. + .. method:: add_static(prefix, path, *, name=None, expect_handler=None, \ chunk_size=256*1024, response_factory=StreamResponse)