Improve custom_protocol.md
This commit is contained in:
parent
6bb4dae5e0
commit
64e0e2d19f
|
@ -27,6 +27,8 @@ When Sanic receives `SIGINT` or `SIGTERM`, `signal.stopped` becomes `True`.
|
||||||
`request_max_size` is bytes of max request size.
|
`request_max_size` is bytes of max request size.
|
||||||
|
|
||||||
## Example
|
## 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
|
```python
|
||||||
from sanic import Sanic
|
from sanic import Sanic
|
||||||
|
|
Loading…
Reference in New Issue
Block a user