Update response.rst

This commit is contained in:
Lagicrus 2020-01-04 19:51:50 +00:00
parent 3430907046
commit cd779b6e4f

View File

@ -107,6 +107,19 @@ Response without encoding the body
def handle_request(request):
return response.raw(b'raw data')
Empty
--------------
For responding with a empty message as defined by `RFC 2616 <https://tools.ietf.org/search/rfc2616#section-7.2.1>`_
.. code-block:: python
from sanic import response
@app.route('/empty')
async def handle_request(request):
return response.empty()
Modify headers or status
------------------------