mirror of https://github.com/encode/starlette.git
Version 0.1.5
This commit is contained in:
parent
77bc250ec6
commit
1c7eb8b409
|
@ -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
|
||||
|
||||
|
|
|
@ -17,4 +17,4 @@ __all__ = (
|
|||
"Request",
|
||||
"TestClient",
|
||||
)
|
||||
__version__ = "0.1.4"
|
||||
__version__ = "0.1.5"
|
||||
|
|
Loading…
Reference in New Issue