- Sort Score
- Result 10 results
- Languages All
Results 1 - 3 of 3 for Dadd (0.12 sec)
-
docs/zh/docs/advanced/middleware.md
``` 但 FastAPI(实际上是 Starlette)提供了一种更简单的方式,能让内部中间件在处理服务器错误的同时,还能让自定义异常处理器正常运作。 为此,要使用 `app.add_middleware()` (与 CORS 中的示例一样)。 ```Python from fastapi import FastAPI from unicorn import UnicornMiddleware app = FastAPI() app.add_middleware(UnicornMiddleware, some_config="rainbow") ``` `app.add_middleware()` 的第一个参数是中间件的类,其它参数则是要传递给中间件的参数。 ## 集成中间件 **FastAPI** 为常见用例提供了一些中间件,下面介绍怎么使用这些中间件。
Plain Text - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Sat Mar 30 22:44:27 GMT 2024 - 3.6K bytes - Viewed (0) -
docs/de/docs/advanced/middleware.md
Plain Text - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Sat Mar 30 20:18:15 GMT 2024 - 4.4K bytes - Viewed (0) -
docs/en/docs/tutorial/middleware.md
### Before and after the `response` You can add code to be run with the `request`, before any *path operation* receives it. And also after the `response` is generated, before returning it. For example, you could add a custom header `X-Process-Time` containing the time in seconds that it took to process the request and generate a response:
Plain Text - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Thu Jan 11 16:31:18 GMT 2024 - 2.9K bytes - Viewed (0)