Merge pull request #1755 from Lagicrus/empty-response

Update docs
This commit is contained in:
Eli Uriegas 2020-01-04 19:15:24 -08:00 committed by GitHub
commit 784d5cce52
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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 an 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
------------------------