Example #1
0
async def response_example(req: Request) -> TextResponse:
    if req.method == "DELETE":
        res = TextResponse("Hello, world!")
        res.headers.append(del_cookie("cookie-1"))
        return res

    return TextResponse("Hello, world!",
                        headers=[set_cookie("cookie-1", "abc")])
Example #2
0
async def other_methods(req: Request) -> TextResponse:
    return TextResponse(req.method)
Example #3
0
async def welcome_methods(req: Request) -> TextResponse:
    return TextResponse(req.method)
Example #4
0
async def root(req: Request) -> TextResponse:
    return TextResponse(req.method)
Example #5
0
async def with_request_ret_asgi(req: Request) -> ASGICallable:
    return TextResponse("Hello, world!")
Example #6
0
async def with_request(req: Request) -> TextResponse:
    return TextResponse("Hello, world!")
Example #7
0
async def root() -> TextResponse:
    return TextResponse("Hello, world!")
Example #8
0
 async def root() -> TextResponse:
     return TextResponse("root")