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"