Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 4 of 4 for ASGI (0.12 sec)

  1. docs/zh/docs/advanced/middleware.md

    以及如何[使用 `CORSMiddleware` 处理 CORS](../tutorial/cors.md){.internal-link target=_blank}。
    
    本章学习如何使用其它中间件。
    
    ## 添加 ASGI 中间件
    
    因为 **FastAPI** 基于 Starlette,且执行 <abbr title="Asynchronous Server Gateway Interface,异步服务器网关界面">ASGI</abbr> 规范,所以可以使用任意 ASGI 中间件。
    
    中间件不必是专为 FastAPI 或 Starlette 定制的,只要遵循 ASGI 规范即可。
    
    总之,ASGI 中间件是类,并把 ASGI 应用作为第一个参数。
    
    因此,有些第三方 ASGI 中间件的文档推荐以如下方式使用中间件:
    
    ```Python
    from unicorn import UnicornMiddleware
    
    app = SomeASGIApp()
    
    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)
  2. docs/de/docs/advanced/middleware.md

    ## ASGI-Middleware hinzufügen
    
    Da **FastAPI** auf Starlette basiert und die <abbr title="Asynchronous Server Gateway Interface">ASGI</abbr>-Spezifikation implementiert, können Sie jede ASGI-Middleware verwenden.
    
    Eine Middleware muss nicht speziell für FastAPI oder Starlette gemacht sein, um zu funktionieren, solange sie der ASGI-Spezifikation genügt.
    
    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)
  3. docs/em/docs/advanced/middleware.md

    ## 🎏 🛠️
    
    📤 📚 🎏 🔫 🛠️.
    
    🖼:
    
    * <a href="https://docs.sentry.io/platforms/python/asgi/" class="external-link" target="_blank">🔫</a>
    * <a href="https://github.com/encode/uvicorn/blob/master/uvicorn/middleware/proxy_headers.py" class="external-link" target="_blank">Uvicorn `ProxyHeadersMiddleware`</a>
    * <a href="https://github.com/florimondmanca/msgpack-asgi" class="external-link" target="_blank">🇸🇲</a>
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat Apr 01 09:26:04 GMT 2023
    - 3.3K bytes
    - Viewed (0)
  4. docs/en/docs/advanced/middleware.md

    ## Adding ASGI middlewares
    
    As **FastAPI** is based on Starlette and implements the <abbr title="Asynchronous Server Gateway Interface">ASGI</abbr> specification, you can use any ASGI middleware.
    
    A middleware doesn't have to be made for FastAPI or Starlette to work, as long as it follows the ASGI spec.
    
    In general, ASGI middlewares are classes that expect to receive an ASGI app as the first argument.
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Mar 10 18:27:10 GMT 2023
    - 4K bytes
    - Viewed (0)
Back to top