Search Options

Results per page
Sort
Preferred Languages
Advance

Results 21 - 30 of 62 for middleware (0.1 sec)

  1. tests/test_dependency_contextvars.py

        request_state = {"user": "deadpond"}
        contextvar_token = legacy_request_state_context_var.set(request_state)
        yield request_state
        legacy_request_state_context_var.reset(contextvar_token)
    
    
    @app.middleware("http")
    async def custom_middleware(
        request: Request, call_next: Callable[[Request], Awaitable[Response]]
    ):
        response = await call_next(request)
        response.headers["custom"] = "foo"
        return response
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Thu Feb 17 12:40:12 UTC 2022
    - 1.5K bytes
    - Viewed (0)
  2. docs/en/docs/reference/fastapi.md

                - get
                - put
                - post
                - delete
                - options
                - head
                - patch
                - trace
                - on_event
                - middleware
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Thu Apr 18 19:53:19 UTC 2024
    - 701 bytes
    - Viewed (0)
  3. docs/ko/docs/tutorial/cors.md

    /// note | "기술적 세부 사항"
    
    `from starlette.middleware.cors import CORSMiddleware` 역시 사용할 수 있습니다.
    
    **FastAPI**는 개발자인 당신의 편의를 위해 `fastapi.middleware` 에서 몇가지의 미들웨어를 제공합니다. 하지만 대부분의 미들웨어가 Stralette으로부터 직접 제공됩니다.
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 5.8K bytes
    - Viewed (0)
  4. docs/em/docs/tutorial/cors.md

    /// note | "📡 ℹ"
    
    👆 💪 ⚙️ `from starlette.middleware.cors import CORSMiddleware`.
    
    **FastAPI** 🚚 📚 🛠️ `fastapi.middleware` 🏪 👆, 👩‍💻. ✋️ 🌅 💪 🛠️ 👟 🔗 ⚪️➡️ 💃.
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 4.1K bytes
    - Viewed (0)
  5. docs/pt/docs/how-to/custom-request-and-route.md

    # Requisições Personalizadas e Classes da APIRoute
    
    Em algum casos, você pode querer sobreescrever a lógica usada pelas classes `Request`e `APIRoute`.
    
    Em particular, isso pode ser uma boa alternativa para uma lógica em um middleware
    
    Por exemplo, se você quiser ler ou manipular o corpo da requisição antes que ele seja processado pela sua aplicação.
    
    /// danger | Perigo
    
    Isso é um recurso "avançado".
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Tue Oct 22 17:33:00 UTC 2024
    - 4.9K bytes
    - Viewed (0)
  6. docs_src/advanced_middleware/tutorial003.py

    from fastapi import FastAPI
    from fastapi.middleware.gzip import GZipMiddleware
    
    app = FastAPI()
    
    app.add_middleware(GZipMiddleware, minimum_size=1000, compresslevel=5)
    
    
    @app.get("/")
    async def main():
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Thu Aug 15 22:38:02 UTC 2024
    - 230 bytes
    - Viewed (0)
  7. cmd/api-router.go

    		// Wrap the actual handler with the appropriate tracing middleware.
    		var tracedHandler http.HandlerFunc
    		if handlerFlags.has(traceHdrsS3HFlag) {
    			tracedHandler = httpTraceHdrs(f)
    		} else {
    			tracedHandler = httpTraceAll(f)
    		}
    
    		// Skip wrapping with the gzip middleware if specified.
    		var gzippedHandler http.HandlerFunc = tracedHandler
    		if !handlerFlags.has(noGZS3HFlag) {
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Tue Aug 13 15:25:16 UTC 2024
    - 23.1K bytes
    - Viewed (0)
  8. docs/tr/docs/advanced/wsgi.md

    ## `WSGIMiddleware` Kullanımı
    
    `WSGIMiddleware`'ı projenize dahil edin.
    
    Ardından WSGI (örneğin Flask) uygulamanızı middleware ile sarmalayın.
    
    Son olarak da bir yol altında bağlama işlemini gerçekleştirin.
    
    ```Python hl_lines="2-3  23"
    {!../../docs_src/wsgi/tutorial001.py!}
    ```
    
    ## Kontrol Edelim
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 1.3K bytes
    - Viewed (0)
  9. docs_src/wsgi/tutorial001.py

    from fastapi import FastAPI
    from fastapi.middleware.wsgi import WSGIMiddleware
    from flask import Flask, request
    from markupsafe import escape
    
    flask_app = Flask(__name__)
    
    
    @flask_app.route("/")
    def flask_main():
        name = request.args.get("name", "World")
        return f"Hello, {escape(name)} from Flask!"
    
    
    app = FastAPI()
    
    
    @app.get("/v2")
    def read_main():
        return {"message": "Hello World"}
    
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Tue May 09 14:32:00 UTC 2023
    - 443 bytes
    - Viewed (0)
  10. docs/de/docs/advanced/wsgi.md

    ## `WSGIMiddleware` verwenden
    
    Sie müssen `WSGIMiddleware` importieren.
    
    Wrappen Sie dann die WSGI-Anwendung (z. B. Flask) mit der Middleware.
    
    Und dann mounten Sie das auf einem Pfad.
    
    ```Python hl_lines="2-3  23"
    {!../../docs_src/wsgi/tutorial001.py!}
    ```
    
    ## Es ansehen
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 1.2K bytes
    - Viewed (0)
Back to top