Search Options

Display Count
Sort
Preferred Language
Advanced Search

Results 1 - 10 of 10 for generate_html_response (0.11 seconds)

The search processing time has exceeded the limit. The displayed results may be partial.

  1. docs_src/custom_response/tutorial004_py310.py

    from fastapi import FastAPI
    from fastapi.responses import HTMLResponse
    
    app = FastAPI()
    
    
    def generate_html_response():
        html_content = """
        <html>
            <head>
                <title>Some HTML in here</title>
            </head>
            <body>
                <h1>Look ma! HTML!</h1>
            </body>
        </html>
        """
        return HTMLResponse(content=html_content, status_code=200)
    
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Feb 12 13:19:43 GMT 2026
    - 491 bytes
    - Click Count (0)
  2. docs/zh-hant/docs/advanced/custom-response.md

    #### 直接回傳 `HTMLResponse` { #return-an-htmlresponse-directly }
    
    例如,可能會像這樣:
    
    {* ../../docs_src/custom_response/tutorial004_py310.py hl[7,21,23] *}
    
    在這個例子中,函式 `generate_html_response()` 已經產生並回傳了一個 `Response`,而不是把 HTML 當作 `str` 回傳。
    
    透過回傳 `generate_html_response()` 的結果,你其實已經回傳了一個 `Response`,這會覆寫 **FastAPI** 的預設行為。
    
    但因為你同時也在 `response_class` 中傳入了 `HTMLResponse`,**FastAPI** 便能在 OpenAPI 與互動式文件中,將其以 `text/html` 的 HTML 形式記錄:
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri Mar 20 17:05:38 GMT 2026
    - 10.3K bytes
    - Click Count (0)
  3. docs/fr/docs/advanced/custom-response.md

    {* ../../docs_src/custom_response/tutorial004_py310.py hl[7,21,23] *}
    
    Dans cet exemple, la fonction `generate_html_response()` génère déjà et renvoie une `Response` au lieu de renvoyer le HTML dans une `str`.
    
    En renvoyant le résultat de l'appel à `generate_html_response()`, vous renvoyez déjà une `Response` qui remplacera le comportement par défaut de **FastAPI**.
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Mar 19 18:37:13 GMT 2026
    - 12.3K bytes
    - Click Count (0)
  4. docs/tr/docs/advanced/custom-response.md

    Örneğin şöyle bir şey olabilir:
    
    {* ../../docs_src/custom_response/tutorial004_py310.py hl[7,21,23] *}
    
    Bu örnekte `generate_html_response()` fonksiyonu, HTML’i bir `str` olarak döndürmek yerine zaten bir `Response` üretip döndürmektedir.
    
    `generate_html_response()` çağrısının sonucunu döndürerek, varsayılan **FastAPI** davranışını override edecek bir `Response` döndürmüş olursunuz.
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri Mar 20 07:53:17 GMT 2026
    - 11.9K bytes
    - Click Count (0)
  5. docs/ko/docs/advanced/custom-response.md

    #### `HTMLResponse` 직접 반환하기 { #return-an-htmlresponse-directly }
    
    예를 들어, 다음과 같이 작성할 수 있습니다:
    
    {* ../../docs_src/custom_response/tutorial004_py310.py hl[7,21,23] *}
    
    이 예제에서 `generate_html_response()` 함수는 HTML을 `str`로 반환하는 대신 이미 `Response`를 생성하고 반환합니다.
    
    `generate_html_response()`를 호출한 결과를 반환함으로써, 기본적인 **FastAPI** 동작을 재정의하는 `Response`를 이미 반환하고 있습니다.
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri Mar 20 14:06:26 GMT 2026
    - 12.4K bytes
    - Click Count (0)
  6. docs/es/docs/advanced/custom-response.md

    Por ejemplo, podría ser algo así:
    
    {* ../../docs_src/custom_response/tutorial004_py310.py hl[7,21,23] *}
    
    En este ejemplo, la función `generate_html_response()` ya genera y devuelve una `Response` en lugar de devolver el HTML en un `str`.
    
    Al devolver el resultado de llamar a `generate_html_response()`, ya estás devolviendo una `Response` que sobrescribirá el comportamiento por defecto de **FastAPI**.
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Mar 19 18:15:55 GMT 2026
    - 11.6K bytes
    - Click Count (0)
  7. docs/ru/docs/advanced/custom-response.md

    Например, это может быть что-то вроде:
    
    {* ../../docs_src/custom_response/tutorial004_py310.py hl[7,21,23] *}
    
    В этом примере функция `generate_html_response()` уже генерирует и возвращает `Response` вместо возврата HTML в `str`.
    
    Возвращая результат вызова `generate_html_response()`, вы уже возвращаете `Response`, который переопределит поведение **FastAPI** по умолчанию.
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Mar 19 17:56:20 GMT 2026
    - 17.6K bytes
    - Click Count (0)
  8. docs/uk/docs/advanced/custom-response.md

    Наприклад, це може бути щось на кшталт:
    
    {* ../../docs_src/custom_response/tutorial004_py310.py hl[7,21,23] *}
    
    У цьому прикладі функція `generate_html_response()` уже генерує та повертає `Response` замість повернення HTML як `str`.
    
    Повертаючи результат виклику `generate_html_response()`, ви вже повертаєте `Response`, яка перепише типову поведінку **FastAPI**.
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Mar 19 18:27:41 GMT 2026
    - 17K bytes
    - Click Count (0)
  9. docs/ja/docs/advanced/custom-response.md

    #### `HTMLResponse` を直接返す { #return-an-htmlresponse-directly }
    
    例えば、次のようになります:
    
    {* ../../docs_src/custom_response/tutorial004_py310.py hl[7,21,23] *}
    
    この例では、関数 `generate_html_response()` はHTMLの `str` を返すのではなく、すでに `Response` を生成して返しています。
    
    `generate_html_response()` の呼び出し結果を返すことで、デフォルトの **FastAPI** の挙動を上書きする `Response` をすでに返しています。
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri Mar 20 14:07:17 GMT 2026
    - 13.5K bytes
    - Click Count (0)
  10. docs/pt/docs/advanced/custom-response.md

    Por exemplo, poderia ser algo como:
    
    {* ../../docs_src/custom_response/tutorial004_py310.py hl[7,21,23] *}
    
    Neste exemplo, a função `generate_html_response()` já cria e retorna uma `Response` em vez de retornar o HTML em uma `str`.
    
    Ao retornar o resultado chamando `generate_html_response()`, você já está retornando uma `Response` que irá sobrescrever o comportamento padrão do **FastAPI**.
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Mar 19 18:20:43 GMT 2026
    - 12K bytes
    - Click Count (0)
Back to Top