Search Options

Results per page
Sort
Preferred Languages
Advance

Results 51 - 60 of 1,466 for respond (0.21 sec)

  1. docs/de/docs/advanced/response-directly.md

    Sehen wir uns nun an, wie Sie damit eine benutzerdefinierte Response zurückgeben können.
    
    Nehmen wir an, Sie möchten eine <a href="https://en.wikipedia.org/wiki/XML" class="external-link" target="_blank">XML</a>-Response zurückgeben.
    
    Sie könnten Ihren XML-Inhalt als String in eine `Response` einfügen und sie zurückgeben:
    
    ```Python hl_lines="1  18"
    {!../../../docs_src/response_directly/tutorial002.py!}
    ```
    
    ## Anmerkungen
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat Mar 30 20:19:36 GMT 2024
    - 3.5K bytes
    - Viewed (0)
  2. docs/zh/docs/advanced/response-headers.md

    ## 使用 `Response` 参数
    
    你可以在你的*路径操作函数*中声明一个`Response`类型的参数(就像你可以为cookies做的那样)。
    
    然后你可以在这个*临时*响应对象中设置头部。
    ```Python hl_lines="1  7-8"
    {!../../../docs_src/response_headers/tutorial002.py!}
    ```
    
    然后你可以像平常一样返回任何你需要的对象(例如一个`dict`或者一个数据库模型)。如果你声明了一个`response_model`,它仍然会被用来过滤和转换你返回的对象。
    
    **FastAPI**将使用这个临时响应来提取头部(也包括cookies和状态码),并将它们放入包含你返回的值的最终响应中,该响应由任何`response_model`过滤。
    
    你也可以在依赖项中声明`Response`参数,并在其中设置头部(和cookies)。
    
    ## 直接返回 `Response`
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 2K bytes
    - Viewed (0)
  3. docs/en/docs/advanced/custom-response.md

        Of course, the actual `Content-Type` header, status code, etc, will come from the `Response` object you returned.
    
    ### Document in OpenAPI and override `Response`
    
    If you want to override the response from inside of the function but at the same time document the "media type" in OpenAPI, you can use the `response_class` parameter AND return a `Response` object.
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 11.7K bytes
    - Viewed (0)
  4. docs/zh/docs/advanced/response-cookies.md

    ## 直接响应 `Response`
    
    你还可以在直接响应`Response`时直接创建cookies。
    
    你可以参考[Return a Response Directly](response-directly.md){.internal-link target=_blank}来创建response
    
    然后设置Cookies,并返回:
    
    ```Python hl_lines="10-12"
    {!../../../docs_src/response_cookies/tutorial001.py!}
    ```
    
    !!! tip
        需要注意,如果你直接反馈一个response对象,而不是使用`Response`入参,FastAPI则会直接反馈你封装的response对象。
    
        所以你需要确保你响应数据类型的正确性,如:你可以使用`JSONResponse`来兼容JSON的场景。
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Aug 18 16:09:38 GMT 2022
    - 2.1K bytes
    - Viewed (0)
  5. docs/en/docs/advanced/response-headers.md

    # Response Headers
    
    ## Use a `Response` parameter
    
    You can declare a parameter of type `Response` in your *path operation function* (as you can do for cookies).
    
    And then you can set headers in that *temporal* response object.
    
    ```Python hl_lines="1  7-8"
    {!../../../docs_src/response_headers/tutorial002.py!}
    ```
    
    And then you can return any object you need, as you normally would (a `dict`, a database model, etc).
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Jan 11 16:31:18 GMT 2024
    - 2.2K bytes
    - Viewed (0)
  6. docs/ru/docs/tutorial/response-model.md

    И ваши помощники разработки также будут счастливы, т.к. оба класса `RedirectResponse` и `JSONResponse` являются подклассами `Response`. Таким образом мы получаем корректную аннотацию типа.
    
    ### Подкласс Response в аннотации типа
    
    Вы также можете указать подкласс `Response` в аннотации типа:
    
    ```Python hl_lines="8-9"
    {!> ../../../docs_src/response_model/tutorial003_03.py!}
    ```
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Mar 22 01:42:11 GMT 2024
    - 30.5K bytes
    - Viewed (0)
  7. docs/em/docs/advanced/custom-response.md

    #### 📨 `HTMLResponse` 🔗
    
    🖼, ⚫️ 💪 🕳 💖:
    
    ```Python hl_lines="7  21  23"
    {!../../../docs_src/custom_response/tutorial004.py!}
    ```
    
    👉 🖼, 🔢 `generate_html_response()` ⏪ 🏗 &amp; 📨 `Response` ↩️ 🛬 🕸 `str`.
    
    🛬 🏁 🤙 `generate_html_response()`, 👆 ⏪ 🛬 `Response` 👈 🔜 🔐 🔢 **FastAPI** 🎭.
    
    ✋️ 👆 🚶‍♀️ `HTMLResponse` `response_class` 💁‍♂️, **FastAPI** 🔜 💭 ❔ 📄 ⚫️ 🗄 &amp; 🎓 🩺 🕸 ⏮️ `text/html`:
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat Apr 01 09:26:04 GMT 2023
    - 9.8K bytes
    - Viewed (0)
  8. docs/em/docs/advanced/response-directly.md

    ⚫️ 💪 ⚠, 🖼, 📨 🛃 🎚 ⚖️ 🍪.
    
    ## 📨 `Response`
    
    👐, 👆 💪 📨 🙆 `Response` ⚖️ 🙆 🎧-🎓 ⚫️.
    
    !!! tip
        `JSONResponse` ⚫️ 🎧-🎓 `Response`.
    
    &amp; 🕐❔ 👆 📨 `Response`, **FastAPI** 🔜 🚶‍♀️ ⚫️ 🔗.
    
    ⚫️ 🏆 🚫 🙆 💽 🛠️ ⏮️ Pydantic 🏷, ⚫️ 🏆 🚫 🗜 🎚 🙆 🆎, ♒️.
    
    👉 🤝 👆 📚 💪. 👆 💪 📨 🙆 📊 🆎, 🔐 🙆 💽 📄 ⚖️ 🔬, ♒️.
    
    ## ⚙️ `jsonable_encoder` `Response`
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat Apr 01 09:26:04 GMT 2023
    - 2.6K bytes
    - Viewed (0)
  9. internal/http/response-recorder.go

    package http
    
    import (
    	"bufio"
    	"bytes"
    	"errors"
    	"fmt"
    	"io"
    	"net"
    	"net/http"
    	"time"
    )
    
    // ResponseRecorder - is a wrapper to trap the http response
    // status code and to record the response body
    type ResponseRecorder struct {
    	http.ResponseWriter
    	io.ReaderFrom
    	StatusCode int
    	// Log body of 4xx or 5xx responses
    	LogErrBody bool
    	// Log body of all responses
    	LogAllBody bool
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Sat Dec 02 00:13:19 GMT 2023
    - 4.9K bytes
    - Viewed (0)
  10. docs/ko/docs/tutorial/response-model.md

    ```Python hl_lines="9  11  16"
    {!../../../docs_src/response_model/tutorial003.py!}
    ```
    
    여기서 *경로 작동 함수*가 비밀번호를 포함하는 동일한 입력 사용자를 반환할지라도:
    
    ```Python hl_lines="24"
    {!../../../docs_src/response_model/tutorial003.py!}
    ```
    
    ...`response_model`을 `UserOut` 모델로 선언했기 때문에 비밀번호를 포함하지 않습니다:
    
    ```Python hl_lines="22"
    {!../../../docs_src/response_model/tutorial003.py!}
    ```
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Mar 22 01:42:11 GMT 2024
    - 8.2K bytes
    - Viewed (0)
Back to top