From 1c7eb8b4090c1280c55e6239bfb9280f9f0aec77 Mon Sep 17 00:00:00 2001 From: Tom Christie Date: Wed, 27 Jun 2018 21:46:09 +0100 Subject: [PATCH] Version 0.1.5 --- README.md | 8 ++++++-- starlette/__init__.py | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 4020e5c8..842915b0 100644 --- a/README.md +++ b/README.md @@ -219,7 +219,7 @@ class App: body = b'' async for chunk in request.stream(): body += chunk - response = Response(content, media_type='text/plain') + response = Response(body, media_type='text/plain') await response(receive, send) ``` @@ -299,10 +299,14 @@ def test_app(): ## Decorators -The `asgi_application` decorator turns an `async` function into an ASGI application. +The `asgi_application` decorator takes a request/response function and turns +it into an ASGI application. The function must take a single `request` argument, and return a response. +The decorator can be applied to either `async` functions, or to standard +functions. + ```python from starlette import asgi_application, HTMLResponse diff --git a/starlette/__init__.py b/starlette/__init__.py index b2953866..248468f6 100644 --- a/starlette/__init__.py +++ b/starlette/__init__.py @@ -17,4 +17,4 @@ __all__ = ( "Request", "TestClient", ) -__version__ = "0.1.4" +__version__ = "0.1.5"