@@ -71,19 +71,19 @@ Alternatively to using query parameters, you can use URL parameters.
7171
7272In 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
7676Notice how the handler function in example below accepts two additional arguments : ``device_id `` and ``action ``.
7777
7878If you specify multiple routes for single handler function and they have different number of URL parameters,
7979make 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
8282Keep in mind that URL parameters are always passed as strings, so you need to convert them to the desired type.
8383Also 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.
8484Look 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