From 4c45d304007b67d0a6ae10b0faa0a9b5443b97e2 Mon Sep 17 00:00:00 2001 From: Seonghyeon Kim Date: Fri, 13 Dec 2019 01:24:11 +0900 Subject: [PATCH] FIX: invalid rst syntax (#1727) --- docs/sanic/request_data.rst | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/docs/sanic/request_data.rst b/docs/sanic/request_data.rst index 7c32fa9b..43434472 100644 --- a/docs/sanic/request_data.rst +++ b/docs/sanic/request_data.rst @@ -224,20 +224,20 @@ The key difference when using this object is the distinction between the `get` a args.getlist('titles') # => ['Post 1', 'Post 2'] -```python -from sanic import Sanic -from sanic.response import json +.. code-block:: python + from sanic import Sanic + from sanic.response import json -app = Sanic(name="example") + app = Sanic(name="example") -@app.route("/") -def get_handler(request): - return json({ - "p1": request.args.getlist("p1") - }) -``` - -## Accessing the handler name with the request.endpoint attribute + @app.route("/") + def get_handler(request): + return json({ + "p1": request.args.getlist("p1") + }) + +Accessing the handler name with the request.endpoint attribute +-------------------------------------------------------------- The `request.endpoint` attribute holds the handler's name. For instance, the below route will return "hello". @@ -253,8 +253,7 @@ route will return "hello". def hello(request): return text(request.endpoint) -Or, with a blueprint it will be include both, separated by a period. For example, - the below route would return foo.bar: +Or, with a blueprint it will be include both, separated by a period. For example, the below route would return foo.bar: .. code-block:: python