raw requires a bytes-like object

raw requires a bytes-like object, or an object that implements __bytes__, not 'str'
This commit is contained in:
panxb
2018-02-15 00:11:37 +08:00
committed by GitHub
parent ad8a168469
commit e735fe54c3

View File

@@ -91,7 +91,7 @@ from sanic import response
@app.route('/raw')
def handle_request(request):
return response.raw('raw data')
return response.raw(b'raw data')
```
## Modify headers or status