From: Tom Christie Date: Wed, 27 Jun 2018 20:46:09 +0000 (+0100) Subject: Version 0.1.5 X-Git-Tag: 0.1.5^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F14%2Fhead;p=thirdparty%2Fstarlette.git Version 0.1.5 --- 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"