- Sort Score
- Result 10 results
- Languages All
Results 11 - 14 of 14 for call_next (0.04 sec)
-
docs/es/docs/tutorial/middleware.md
/// ## Crear un middleware { #create-a-middleware } Para crear un middleware usas el decorador `@app.middleware("http")` encima de una función. La función middleware recibe: * La `request`. * Una función `call_next` que recibirá la `request` como parámetro. * Esta función pasará la `request` a la correspondiente *path operation*. * Luego devuelve la `response` generada por la correspondiente *path operation*.Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Wed Dec 17 20:41:43 UTC 2025 - 4.3K bytes - Viewed (0) -
docs/ja/docs/tutorial/middleware.md
バックグラウンドタスク (後述) がある場合は、それらは全てのミドルウェアの *後に* 実行されます。 /// ## ミドルウェアの作成 ミドルウェアを作成するには、関数の上部でデコレータ `@app.middleware("http")` を使用します。 ミドルウェア関数は以下を受け取ります: * `request`。 * パラメータとして `request` を受け取る関数 `call_next`。 * この関数は、対応する*path operation*に `request` を渡します。 * 次に、対応する*path operation*によって生成された `response` を返します。 * その後、`response` を返す前にさらに `response` を変更することもできます。 {* ../../docs_src/middleware/tutorial001.py hl[8:9,11,14] *}
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Sat Oct 11 17:48:49 UTC 2025 - 3.8K bytes - Viewed (0) -
docs/en/docs/tutorial/middleware.md
## Create a middleware { #create-a-middleware } To create a middleware you use the decorator `@app.middleware("http")` on top of a function. The middleware function receives: * The `request`. * A function `call_next` that will receive the `request` as a parameter. * This function will pass the `request` to the corresponding *path operation*. * Then it returns the `response` generated by the corresponding *path operation*.Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Wed Dec 17 20:41:43 UTC 2025 - 4.1K bytes - Viewed (0) -
fastapi/applications.py
app = FastAPI() @app.middleware("http") async def add_process_time_header( request: Request, call_next: Callable[[Request], Awaitable[Response]] ) -> Response: start_time = time.time() response = await call_next(request) process_time = time.time() - start_time response.headers["X-Process-Time"] = str(process_time)
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Wed Dec 17 21:25:59 UTC 2025 - 176.3K bytes - Viewed (0)