From b7ef8faf1baa9d10a5ff4af886ba89dc5485b9fc Mon Sep 17 00:00:00 2001 From: Tom Christie Date: Mon, 25 Jun 2018 14:24:50 +0100 Subject: [PATCH] Tweak README --- README.md | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 9b148518..f98ba08c 100644 --- a/README.md +++ b/README.md @@ -13,6 +13,10 @@

+

— ⭐️ —

+ +Starlette is a small library for + ```python from starlette import Response @@ -108,6 +112,8 @@ class App: await response(receive, send) ``` +

— ⭐️ —

+ ## Requests Starlette includes a `Request` class that gives you a nicer interface onto @@ -133,7 +139,7 @@ class App: The request method is accessed as `request.method`. -### URL +#### URL The request URL is accessed as `request.url`. @@ -142,19 +148,19 @@ components that can be parsed out of the URL. For example: `request.url.path`, `request.url.port`, `request.url.scheme`. -### Headers +#### Headers Headers are exposed as an immutable, case-insensitive, multi-dict. For example: `request.headers['content-type']` -### Query Parameters +#### Query Parameters Headers are exposed as an immutable multi-dict. For example: `request.query_params['abc']` -### Body +#### Body There are two interfaces for returning the body of the request: @@ -162,6 +168,8 @@ The request body as bytes: `await request.body()` The request body, parsed as JSON: `await request.json()` +

— ⭐️ —

+ ## Test Client The test client allows you to make requests against your ASGI application, @@ -186,6 +194,8 @@ def test_app(): assert response.status_code == 200 ``` +

— ⭐️ —

+ ## Decorators The `asgi_application` decorator turns an `async` function into an ASGI application. @@ -203,4 +213,4 @@ async def app(request): --- -

API Star is BSD licensed code.
Designed & built in Brighton, England.

— ⭐️ —

+

API Star is BSD licensed code.
Designed & built in Brighton, England.

-- 2.47.3