Skip to content

Commit e6ad4d0

Browse files
committed
Minor changes in docs for examples
1 parent d70e2c5 commit e6ad4d0

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

docs/examples.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,19 +71,19 @@ Alternatively to using query parameters, you can use URL parameters.
7171

7272
In order to use URL parameters, you need to wrap them inside ``<>`` in ``HTTPServer.route``, e.g. ``<my_parameter>``.
7373

74-
All URL parameters are passed as positional arguments to the handler function, in order they are specified.
74+
All URL parameters are **passed as positional (not keyword) arguments** to the handler function, in order they are specified in ``HTTPServer.route``.
7575

7676
Notice how the handler function in example below accepts two additional arguments : ``device_id`` and ``action``.
7777

7878
If you specify multiple routes for single handler function and they have different number of URL parameters,
7979
make sure to add default values for all the ones that might not be passed.
80-
In the example below the second route has only one URL parameter, so the ``action`` parameter has a default value of ``None``.
80+
In the example below the second route has only one URL parameter, so the ``action`` parameter has a default value.
8181

8282
Keep in mind that URL parameters are always passed as strings, so you need to convert them to the desired type.
8383
Also note that the names of the function parameters **do not have to match** with the ones used in route, but they **must** be in the same order.
8484
Look at the example below to see how the ``route_param_1`` and ``route_param_1`` are named differently in the handler function.
8585

86-
Although it is possible, it makes more sens be consistent with the names of the parameters in the route and in the handler function.
86+
Although it is possible, it makes more sense be consistent with the names of the parameters in the route and in the handler function.
8787

8888
.. literalinclude:: ../examples/httpserver_url_parameters.py
8989
:caption: examples/httpserver_url_parameters.py

0 commit comments

Comments
 (0)