Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: sanic-org/sanic
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 0.6.0
Choose a base ref
...
head repository: sanic-org/sanic
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 0.7.0
Choose a head ref

Commits on Jul 12, 2017

  1. Copy the full SHA
    47abf83 View commit details

Commits on Jul 26, 2017

  1. Copy the full SHA
    429f737 View commit details

Commits on Aug 2, 2017

  1. Merge pull request #9 from channelcat/master

    merging upstream master branch
    yunstanford authored Aug 2, 2017
    Copy the full SHA
    181ffb0 View commit details
  2. fixed small doc issue

    yunstanford committed Aug 2, 2017
    Copy the full SHA
    f99a723 View commit details

Commits on Aug 3, 2017

  1. Copy the full SHA
    7216bf7 View commit details

Commits on Aug 4, 2017

  1. Merge pull request #870 from MichaelYusko/small-amendment

    Did the small changes for better readable
    r0fls authored Aug 4, 2017
    Copy the full SHA
    7b66a56 View commit details

Commits on Aug 8, 2017

  1. Weboscket subprotocol negotiation

    Fixes #874
    miguelgrinberg committed Aug 8, 2017
    Copy the full SHA
    375ed23 View commit details
  2. Merge pull request #883 from miguelgrinberg/websocket-subprotocols

    Weboscket subprotocol negotiation
    seemethere authored Aug 8, 2017
    Copy the full SHA
    c797c3f View commit details

Commits on Aug 9, 2017

  1. Copy the full SHA
    d5d1d3b View commit details
  2. Copy the full SHA
    80f27b1 View commit details
  3. Merge pull request #885 from yunstanford/master

    add triggers events when async create_server
    r0fls authored Aug 9, 2017
    Copy the full SHA
    df4a149 View commit details

Commits on Aug 10, 2017

  1. Merge pull request #10 from channelcat/master

    merge upstream master branch
    yunstanford authored Aug 10, 2017
    Copy the full SHA
    bda6c85 View commit details
  2. fix cov report

    yunstanford committed Aug 10, 2017
    Copy the full SHA
    fbb2344 View commit details
  3. Copy the full SHA
    756bd19 View commit details

Commits on Aug 14, 2017

  1. Merge pull request #886 from yunstanford/fix-cov-report

    Fix cov report
    r0fls authored Aug 14, 2017
    Copy the full SHA
    4155e76 View commit details

Commits on Aug 15, 2017

  1. Fix blueprint doc

    dongweiming committed Aug 15, 2017
    Copy the full SHA
    2587f67 View commit details

Commits on Aug 16, 2017

  1. Merge pull request #889 from dongweiming/doc

    Fix blueprint doc
    r0fls authored Aug 16, 2017
    Copy the full SHA
    0dbde74 View commit details

Commits on Aug 18, 2017

  1. docs(README): Make it clear and easy to read.

    jiaxiaolei committed Aug 18, 2017
    Copy the full SHA
    dd241bd View commit details
  2. Merge pull request #892 from jiaxiaolei/master

    docs(README): Make it clear and easy to read.
    r0fls authored Aug 18, 2017
    Copy the full SHA
    c96bd21 View commit details
  3. fix typo

    pkuphy authored Aug 18, 2017
    Copy the full SHA
    a55efc8 View commit details
  4. Merge pull request #894 from pkuphy/patch-1

    fix typo
    seemethere authored Aug 18, 2017
    Copy the full SHA
    750115b View commit details

Commits on Aug 20, 2017

  1. feat(exapmles): add add_task_sanic.py

    jiaxiaolei committed Aug 20, 2017
    Copy the full SHA
    947364e View commit details
  2. Copy the full SHA
    439ff11 View commit details

Commits on Aug 21, 2017

  1. Merge pull request #11 from channelcat/master

    merge upstream master branch
    yunstanford authored Aug 21, 2017
    Copy the full SHA
    747c21d View commit details
  2. Copy the full SHA
    ef81a9f View commit details
  3. add unit tests

    yunstanford committed Aug 21, 2017
    Copy the full SHA
    5d23c76 View commit details
  4. Merge pull request #899 from hatarist/patch-2

    Add a line on headers in the "Request Data" docs
    r0fls authored Aug 21, 2017
    Copy the full SHA
    db9924a View commit details
  5. add doc

    yunstanford committed Aug 21, 2017
    Copy the full SHA
    63babae View commit details
  6. Merge pull request #900 from yunstanford/patch-default-strict-slashes

    Patch default strict slashes
    r0fls authored Aug 21, 2017
    Copy the full SHA
    fa1a95a View commit details
  7. Merge pull request #898 from jiaxiaolei/master

    feat(examples): add `add_task_sanic.py`
    r0fls authored Aug 21, 2017
    Copy the full SHA
    826f1b4 View commit details
  8. Copy the full SHA
    eab809d View commit details
  9. feat(examples): add authorized_sanic.py

    You can check a request if the client is authorized
    to access a resource by the decorator `authorized`
    jiaxiaolei committed Aug 21, 2017
    Copy the full SHA
    91f031b View commit details

Commits on Aug 22, 2017

  1. Copy the full SHA
    762b278 View commit details
  2. Copy the full SHA
    145cdd5 View commit details
  3. fix: error param

    xmsun committed Aug 22, 2017
    Copy the full SHA
    35e028c View commit details

Commits on Aug 23, 2017

  1. Merge pull request #908 from Ezi4Zy/master

    fix: error param
    r0fls authored Aug 23, 2017
    Copy the full SHA
    fee9de9 View commit details

Commits on Aug 24, 2017

  1. Copy the full SHA
    6038813 View commit details
  2. Merge pull request #917 from CharAct3/bugfix/fix_unauthorized

    fix #914, change arguments of Unauthorized.__init__
    r0fls authored Aug 24, 2017
    Copy the full SHA
    5011bfe View commit details

Commits on Aug 29, 2017

  1. Copy the full SHA
    0a72168 View commit details

Commits on Aug 30, 2017

  1. Fix LICENSE date and name

    manisenkov committed Aug 30, 2017
    Copy the full SHA
    f49554a View commit details

Commits on Aug 31, 2017

  1. Merge pull request #926 from manisenkov/patch-1

    Fix LICENSE date and name
    r0fls authored Aug 31, 2017
    Copy the full SHA
    7a6f2d8 View commit details
  2. Merge pull request #904 from jiaxiaolei/master

    feat(examples): add `authorized_sanic.py`
    seemethere authored Aug 31, 2017
    Copy the full SHA
    90e5c8d View commit details
  3. Merge pull request #922 from timka/patch-1

    Example logging X-Request-Id transparently
    seemethere authored Aug 31, 2017
    Copy the full SHA
    78a7338 View commit details
  4. Merge pull request #901 from lixxu/master

    add name option for route building
    r0fls authored Aug 31, 2017
    Copy the full SHA
    158da09 View commit details

Commits on Sep 5, 2017

  1. Copy the full SHA
    c59a8a6 View commit details
  2. Copy the full SHA
    97d8b9e View commit details
  3. test for env var prefix

    Archelyst committed Sep 5, 2017
    Copy the full SHA
    9572ecc View commit details
  4. fixed flake convention

    Archelyst committed Sep 5, 2017
    Copy the full SHA
    e2e25eb View commit details
  5. Merge pull request #931 from Tim-Erwin/envvar_prefix

    make the prefix for environment variables alterable
    r0fls authored Sep 5, 2017
    Copy the full SHA
    8b4ca51 View commit details

Commits on Sep 6, 2017

  1. Copy the full SHA
    bc20dc5 View commit details
Showing with 2,826 additions and 582 deletions.
  1. +2 −2 LICENSE
  2. +3 −0 MANIFEST.in
  3. +2 −2 README.rst
  4. +1 −1 docs/conf.py
  5. +9 −2 docs/sanic/blueprints.md
  6. +40 −7 docs/sanic/config.md
  7. +2 −1 docs/sanic/extensions.md
  8. +5 −4 docs/sanic/getting_started.md
  9. +20 −54 docs/sanic/logging.md
  10. +1 −1 docs/sanic/middleware.md
  11. +7 −0 docs/sanic/request_data.md
  12. +118 −0 docs/sanic/routing.md
  13. +27 −3 docs/sanic/static_files.md
  14. +17 −0 examples/add_task_sanic.py
  15. +42 −0 examples/authorized_sanic.py
  16. +86 −0 examples/log_request_id.py
  17. +49 −0 examples/pytest_xdist.py
  18. +13 −0 examples/teapot.py
  19. +1 −1 examples/try_everything.py
  20. +1 −0 requirements-docs.txt
  21. +1 −1 sanic/__init__.py
  22. +6 −6 sanic/__main__.py
  23. +142 −73 sanic/app.py
  24. +80 −40 sanic/blueprints.py
  25. +8 −99 sanic/config.py
  26. +2 −1 sanic/cookies.py
  27. +34 −14 sanic/exceptions.py
  28. +12 −12 sanic/handlers.py
  29. +56 −11 sanic/log.py
  30. +45 −15 sanic/request.py
  31. +37 −28 sanic/response.py
  32. +65 −28 sanic/router.py
  33. +188 −105 sanic/server.py
  34. +10 −3 sanic/static.py
  35. +9 −8 sanic/testing.py
  36. +25 −4 sanic/websocket.py
  37. +13 −8 sanic/worker.py
  38. +1 −1 setup.py
  39. +1 −0 tests/static/bp/decode me.txt
  40. BIN tests/static/bp/python.png
  41. +1 −0 tests/static/bp/test.file
  42. +59 −0 tests/test_blueprints.py
  43. +8 −2 tests/test_config.py
  44. +21 −2 tests/test_cookies.py
  45. +19 −5 tests/test_exceptions.py
  46. +269 −0 tests/test_keep_alive_timeout.py
  47. +63 −13 tests/test_logging.py
  48. +1 −1 tests/test_middleware.py
  49. +388 −0 tests/test_named_routes.py
  50. +143 −18 tests/test_request_timeout.py
  51. +10 −0 tests/test_requests.py
  52. +30 −0 tests/test_response.py
  53. +38 −0 tests/test_response_timeout.py
  54. +102 −0 tests/test_routes.py
  55. +17 −0 tests/test_server_events.py
  56. +17 −0 tests/test_static.py
  57. +8 −4 tests/test_url_building.py
  58. +446 −0 tests/test_url_for_static.py
  59. +1 −1 tests/test_worker.py
  60. +4 −1 tox.ini
4 changes: 2 additions & 2 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) [year] [fullname]
Copyright (c) 2016-present Channel Cat

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
@@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
SOFTWARE.
3 changes: 3 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
include README.rst
include MANIFEST.in
include LICENSE
include setup.py

recursive-exclude * __pycache__
recursive-exclude * *.py[co]
4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
@@ -31,13 +31,13 @@ Hello World Example
Installation
------------

- ``python -m pip install sanic``
- ``pip install sanic``

To install sanic without uvloop or json using bash, you can provide either or both of these environmental variables
using any truthy string like `'y', 'yes', 't', 'true', 'on', '1'` and setting the NO_X to true will stop that features
installation.

- ``SANIC_NO_UVLOOP=true SANIC_NO_UJSON=true python -m pip install sanic``
- ``SANIC_NO_UVLOOP=true SANIC_NO_UJSON=true pip install sanic``


Documentation
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
@@ -25,7 +25,7 @@

# -- General configuration ------------------------------------------------

extensions = ['sphinx.ext.autodoc']
extensions = ['sphinx.ext.autodoc', 'sphinxcontrib.asyncio']

templates_path = ['_templates']

11 changes: 9 additions & 2 deletions docs/sanic/blueprints.md
Original file line number Diff line number Diff line change
@@ -93,7 +93,14 @@ def ignore_404s(request, exception):
Static files can be served globally, under the blueprint prefix.

```python
bp.static('/folder/to/serve', '/web/path')

# suppose bp.name == 'bp'

bp.static('/web/path', '/folder/to/serve')
# also you can pass name parameter to it for url_for
bp.static('/web/path', '/folder/to/server', name='uploads')
app.url_for('static', name='bp.uploads', filename='file.txt') == '/bp/web/path/file.txt'

```

## Start and stop
@@ -172,7 +179,7 @@ takes the format `<blueprint_name>.<handler_name>`. For example:
```python
@blueprint_v1.route('/')
async def root(request):
url = app.url_for('v1.post_handler', post_id=5) # --> '/v1/post/5'
url = request.app.url_for('v1.post_handler', post_id=5) # --> '/v1/post/5'
return redirect(url)


47 changes: 40 additions & 7 deletions docs/sanic/config.md
Original file line number Diff line number Diff line change
@@ -29,9 +29,15 @@ In general the convention is to only have UPPERCASE configuration parameters. Th

There are several ways how to load configuration.

### From environment variables.
### From Environment Variables

Any variables defined with the `SANIC_` prefix will be applied to the sanic config. For example, setting `SANIC_REQUEST_TIMEOUT` will be loaded by the application automatically. You can pass the `load_env` boolean to the Sanic constructor to override that:
Any variables defined with the `SANIC_` prefix will be applied to the sanic config. For example, setting `SANIC_REQUEST_TIMEOUT` will be loaded by the application automatically and fed into the `REQUEST_TIMEOUT` config variable. You can pass a different prefix to Sanic:

```python
app = Sanic(load_env='MYAPP_')
```

Then the above variable would be `MYAPP_REQUEST_TIMEOUT`. If you want to disable loading from environment variables you can set it to `False` instead:

```python
app = Sanic(load_env=False)
@@ -79,8 +85,35 @@ DB_USER = 'appuser'

Out of the box there are just a few predefined values which can be overwritten when creating the application.

| Variable | Default | Description |
| ----------------- | --------- | --------------------------------- |
| REQUEST_MAX_SIZE | 100000000 | How big a request may be (bytes) |
| REQUEST_TIMEOUT | 60 | How long a request can take (sec) |
| KEEP_ALIVE | True | Disables keep-alive when False |
| Variable | Default | Description |
| ------------------ | --------- | --------------------------------------------- |
| REQUEST_MAX_SIZE | 100000000 | How big a request may be (bytes) |
| REQUEST_TIMEOUT | 60 | How long a request can take to arrive (sec) |
| RESPONSE_TIMEOUT | 60 | How long a response can take to process (sec) |
| KEEP_ALIVE | True | Disables keep-alive when False |
| KEEP_ALIVE_TIMEOUT | 5 | How long to hold a TCP connection open (sec) |

### The different Timeout variables:

A request timeout measures the duration of time between the instant when a new open TCP connection is passed to the Sanic backend server, and the instant when the whole HTTP request is received. If the time taken exceeds the `REQUEST_TIMEOUT` value (in seconds), this is considered a Client Error so Sanic generates a HTTP 408 response and sends that to the client. Adjust this value higher if your clients routinely pass very large request payloads or upload requests very slowly.

A response timeout measures the duration of time between the instant the Sanic server passes the HTTP request to the Sanic App, and the instant a HTTP response is sent to the client. If the time taken exceeds the `RESPONSE_TIMEOUT` value (in seconds), this is considered a Server Error so Sanic generates a HTTP 503 response and sets that to the client. Adjust this value higher if your application is likely to have long-running process that delay the generation of a response.

### What is Keep Alive? And what does the Keep Alive Timeout value do?

Keep-Alive is a HTTP feature indroduced in HTTP 1.1. When sending a HTTP request, the client (usually a web browser application) can set a Keep-Alive header to indicate for the http server (Sanic) to not close the TCP connection after it has send the response. This allows the client to reuse the existing TCP connection to send subsequent HTTP requests, and ensures more efficient network traffic for both the client and the server.

The `KEEP_ALIVE` config variable is set to `True` in Sanic by default. If you don't need this feature in your application, set it to `False` to cause all client connections to close immediately after a response is sent, regardless of the Keep-Alive header on the request.

The amount of time the server holds the TCP connection open is decided by the server itself. In Sanic, that value is configured using the `KEEP_ALIVE_TIMEOUT` value. By default, it is set to 5 seconds, this is the same default setting as the Apache HTTP server and is a good balance between allowing enough time for the client to send a new request, and not holding open too many connections at once. Do not exceed 75 seconds unless you know your clients are using a browser which supports TCP connections held open for that long.

For reference:
```
Apache httpd server default keepalive timeout = 5 seconds
Nginx server default keepalive timeout = 75 seconds
Nginx performance tuning guidelines uses keepalive = 15 seconds
IE (5-9) client hard keepalive limit = 60 seconds
Firefox client hard keepalive limit = 115 seconds
Opera 11 client hard keepalive limit = 120 seconds
Chrome 13+ client keepalive limit > 300+ seconds
```
3 changes: 2 additions & 1 deletion docs/sanic/extensions.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
# Extensions

A list of Sanic extensions created by the community.

- [Sanic-Plugins-Framework](https://github.com/ashleysommer/sanicpluginsframework): Library for easily creating and using Sanic plugins.
- [Sessions](https://github.com/subyraman/sanic_session): Support for sessions.
Allows using redis, memcache or an in memory store.
- [CORS](https://github.com/ashleysommer/sanic-cors): A port of flask-cors.
- [Compress](https://github.com/subyraman/sanic_compress): Allows you to easily gzip Sanic responses. A port of Flask-Compress.
- [Jinja2](https://github.com/lixxu/sanic-jinja2): Support for Jinja2 template.
- [JWT](https://github.com/ahopkins/sanic-jwt): Authentication extension for JSON Web Tokens (JWT).
- [OpenAPI/Swagger](https://github.com/channelcat/sanic-openapi): OpenAPI support, plus a Swagger UI.
- [Pagination](https://github.com/lixxu/python-paginate): Simple pagination support.
- [Motor](https://github.com/lixxu/sanic-motor): Simple motor wrapper.
9 changes: 5 additions & 4 deletions docs/sanic/getting_started.md
Original file line number Diff line number Diff line change
@@ -9,15 +9,16 @@ syntax, so earlier versions of python won't work.

```python
from sanic import Sanic
from sanic.response import text
from sanic.response import json

app = Sanic(__name__)
app = Sanic()

@app.route("/")
async def test(request):
return text('Hello world!')
return json({"hello": "world"})

app.run(host="0.0.0.0", port=8000, debug=True)
if __name__ == "__main__":
app.run(host="0.0.0.0", port=8000)
```

3. Run the server: `python3 main.py`
74 changes: 20 additions & 54 deletions docs/sanic/logging.md
Original file line number Diff line number Diff line change
@@ -9,12 +9,6 @@ A simple example using default settings would be like this:

```python
from sanic import Sanic
from sanic.config import LOGGING

# The default logging handlers are ['accessStream', 'errorStream']
# but we change it to use other handlers here for demo purpose
LOGGING['loggers']['network']['handlers'] = [
'accessSysLog', 'errorSysLog']

app = Sanic('test')

@@ -23,79 +17,51 @@ async def test(request):
return response.text('Hello World!')

if __name__ == "__main__":
app.run(log_config=LOGGING)
app.run(debug=True, access_log=True)
```

To use your own logging config, simply use `logging.config.dictConfig`, or
pass `log_config` when you initialize `Sanic` app:

```python
app = Sanic('test', log_config=LOGGING_CONFIG)
```

And to close logging, simply assign log_config=None:
And to close logging, simply assign access_log=False:

```python
if __name__ == "__main__":
app.run(log_config=None)
app.run(access_log=False)
```

This would skip calling logging functions when handling requests.
And you could even do further in production to gain extra speed:

```python
if __name__ == "__main__":
# disable internal messages
app.run(debug=False, log_config=None)
# disable debug messages
app.run(debug=False, access_log=False)
```

### Configuration

By default, log_config parameter is set to use sanic.config.LOGGING dictionary for configuration. The default configuration provides several predefined `handlers`:

- internal (using [logging.StreamHandler](https://docs.python.org/3/library/logging.handlers.html#logging.StreamHandler))<br>
For internal information console outputs.


- accessStream (using [logging.StreamHandler](https://docs.python.org/3/library/logging.handlers.html#logging.StreamHandler))<br>
For requests information logging in console


- errorStream (using [logging.StreamHandler](https://docs.python.org/3/library/logging.handlers.html#logging.StreamHandler))<br>
For error message and traceback logging in console.


- accessSysLog (using [logging.handlers.SysLogHandler](https://docs.python.org/3/library/logging.handlers.html#logging.handlers.SysLogHandler))<br>
For requests information logging to syslog.
Currently supports Windows (via localhost:514), Darwin (/var/run/syslog),
Linux (/dev/log) and FreeBSD (/dev/log).<br>
You would not be able to access this property if the directory doesn't exist.
(Notice that in Docker you have to enable everything by yourself)


- errorSysLog (using [logging.handlers.SysLogHandler](https://docs.python.org/3/library/logging.handlers.html#logging.handlers.SysLogHandler))<br>
For error message and traceback logging to syslog.
Currently supports Windows (via localhost:514), Darwin (/var/run/syslog),
Linux (/dev/log) and FreeBSD (/dev/log).<br>
You would not be able to access this property if the directory doesn't exist.
(Notice that in Docker you have to enable everything by yourself)


And `filters`:

- accessFilter (using sanic.log.DefaultFilter)<br>
The filter that allows only levels in `DEBUG`, `INFO`, and `NONE(0)`


- errorFilter (using sanic.log.DefaultFilter)<br>
The filter that allows only levels in `WARNING`, `ERROR`, and `CRITICAL`
By default, log_config parameter is set to use sanic.log.LOGGING_CONFIG_DEFAULTS dictionary for configuration.

There are two `loggers` used in sanic, and **must be defined if you want to create your own logging configuration**:
There are three `loggers` used in sanic, and **must be defined if you want to create your own logging configuration**:

- sanic:<br>
- root:<br>
Used to log internal messages.

- sanic.error:<br>
Used to log error logs.

- network:<br>
Used to log requests from network, and any information from those requests.
- sanic.access:<br>
Used to log access logs.

#### Log format:

In addition to default parameters provided by python (asctime, levelname, message),
Sanic provides additional parameters for network logger with accessFilter:
Sanic provides additional parameters for access logger with:

- host (str)<br>
request.ip
2 changes: 1 addition & 1 deletion docs/sanic/middleware.md
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@ Middleware are functions which are executed before or after requests to the
server. They can be used to modify the *request to* or *response from*
user-defined handler functions.

Additionally, Sanic providers listeners which allow you to run code at various points of your application's lifecycle.
Additionally, Sanic provides listeners which allow you to run code at various points of your application's lifecycle.

## Middleware

7 changes: 7 additions & 0 deletions docs/sanic/request_data.md
Original file line number Diff line number Diff line change
@@ -71,8 +71,14 @@ The following variables are accessible as properties on `Request` objects:
return text("You are trying to create a user with the following POST: %s" % request.body)
```

- `headers` (dict) - A case-insensitive dictionary that contains the request headers.

- `ip` (str) - IP address of the requester.

- `port` (str) - Port address of the requester.

- `socket` (tuple) - (IP, port) of the requester.

- `app` - a reference to the Sanic application object that is handling this request. This is useful when inside blueprints or other handlers in modules that do not have access to the global `app` object.

```python
@@ -95,6 +101,7 @@ The following variables are accessible as properties on `Request` objects:
- `path`: The path of the request: `/posts/1/`
- `query_string`: The query string of the request: `foo=bar` or a blank string `''`
- `uri_template`: Template for matching route handler: `/posts/<id>/`
- `token`: The value of Authorization header: `Basic YWRtaW46YWRtaW4=`


## Accessing values using `get` and `getlist`
Loading