Improve custom_protocol.md

This commit is contained in:
38elements 2016-12-29 16:41:04 +09:00 committed by GitHub
parent 6bb4dae5e0
commit 64e0e2d19f

View File

@ -27,6 +27,8 @@ When Sanic receives `SIGINT` or `SIGTERM`, `signal.stopped` becomes `True`.
`request_max_size` is bytes of max request size.
## Example
By default protocol, an error occurs, if the handler does not return an `HTTPResponse object`.
In this example, By rewriting `write_response()`, if the handler returns `str`, it will be converted to an `HTTPResponse object`.
```python
from sanic import Sanic