Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 329 for requests (0.14 sec)

  1. docs/zh/docs/advanced/using-request-directly.md

    但在某些特定情况下,还是需要提取 `Request` 对象。
    
    ## 直接使用 `Request` 对象
    
    假设要在*路径操作函数*中获取客户端 IP 地址和主机。
    
    此时,需要直接访问请求。
    
    ```Python hl_lines="1  7-8"
    {!../../../docs_src/using_request_directly/tutorial001.py!}
    ```
    
    把*路径操作函数*的参数类型声明为 `Request`,**FastAPI** 就能把 `Request` 传递到参数里。
    
    !!! tip "提示"
    
        注意,本例除了声明请求参数之外,还声明了路径参数。
    
        因此,能够提取、验证路径参数、并转换为指定类型,还可以用 OpenAPI 注释。
    
        同样,您也可以正常声明其它参数,而且还可以提取 `Request`。
    
    ## `Request` 文档
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat Mar 30 22:44:02 GMT 2024
    - 2K bytes
    - Viewed (0)
  2. docs/en/docs/alternatives.md

    
    ### <a href="https://requests.readthedocs.io" class="external-link" target="_blank">Requests</a>
    
    **FastAPI** is not actually an alternative to **Requests**. Their scope is very different.
    
    It would actually be common to use Requests *inside* of a FastAPI application.
    
    But still, FastAPI got quite some inspiration from Requests.
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 23.2K bytes
    - Viewed (0)
  3. docs/de/docs/advanced/openapi-callbacks.md

    !!! tip "Tipp"
        Der eigentliche Callback ist nur ein HTTP-Request.
    
        Wenn Sie den Callback selbst implementieren, können Sie beispielsweise <a href="https://www.python-httpx.org" class="external-link" target="_blank">HTTPX</a> oder <a href="https://requests.readthedocs.io/" class="external-link" target="_blank">Requests</a> verwenden.
    
    ## Schreiben des Codes, der den Callback dokumentiert
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat Mar 30 20:17:23 GMT 2024
    - 8.8K bytes
    - Viewed (0)
  4. docs/en/docs/advanced/middleware.md

    ## `HTTPSRedirectMiddleware`
    
    Enforces that all incoming requests must either be `https` or `wss`.
    
    Any incoming requests to `http` or `ws` will be redirected to the secure scheme instead.
    
    ```Python hl_lines="2  6"
    {!../../../docs_src/advanced_middleware/tutorial001.py!}
    ```
    
    ## `TrustedHostMiddleware`
    
    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)
  5. docs/en/docs/tutorial/testing.md

    ```Python
    {!> ../../../docs_src/app_testing/app_b/test_main.py!}
    ```
    
    Whenever you need the client to pass information in the request and you don't know how to, you can search (Google) how to do it in `httpx`, or even how to do it with `requests`, as HTTPX's design is based on Requests' design.
    
    Then you just do the same in your tests.
    
    E.g.:
    
    * To pass a *path* or *query* parameter, add it to the URL itself.
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 6.2K bytes
    - Viewed (0)
  6. docs/en/docs/contributing.md

        Check the docs about <a href="https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/about-pull-request-reviews" class="external-link" target="_blank">adding a pull request review</a> to approve it or request changes.
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Jan 11 17:42:43 GMT 2024
    - 14.1K bytes
    - Viewed (0)
  7. docs/de/docs/deployment/https.md

    ### Den Request entschlüsseln
    
    Der TLS-Terminierungsproxy würde die vereinbarte Verschlüsselung zum **Entschlüsseln des Requests** verwenden und den **einfachen (entschlüsselten) HTTP-Request** an den Prozess weiterleiten, der die Anwendung ausführt (z. B. einen Prozess, bei dem Uvicorn die FastAPI-Anwendung ausführt).
    
    <img src="/img/deployment/https/https05.svg">
    
    ### HTTP-Response
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat Mar 30 20:16:46 GMT 2024
    - 13.5K bytes
    - Viewed (0)
  8. docs/en/docs/how-to/custom-request-and-route.md

    Some use cases include:
    
    * Converting non-JSON request bodies to JSON (e.g. <a href="https://msgpack.org/index.html" class="external-link" target="_blank">`msgpack`</a>).
    * Decompressing gzip-compressed request bodies.
    * Automatically logging all request bodies.
    
    ## Handling custom request body encodings
    
    Let's see how to make use of a custom `Request` subclass to decompress gzip requests.
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sun Mar 31 23:52:53 GMT 2024
    - 4.4K bytes
    - Viewed (0)
  9. docs/de/docs/advanced/events.md

    Die gleichen Modelle werden von den Requests gemeinsam genutzt, es handelt sich also nicht um ein Modell pro Request, pro Benutzer, oder ähnliches.
    
    Stellen wir uns vor, dass das Laden des Modells **eine ganze Weile dauern** kann, da viele **Daten von der Festplatte** gelesen werden müssen. Sie möchten das also nicht für jeden Request tun.
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat Mar 30 20:30:59 GMT 2024
    - 9.1K bytes
    - Viewed (0)
  10. docs/zh/docs/advanced/custom-request-and-route.md

    ```Python hl_lines="18-26"
    {!../../../docs_src/custom_request_and_route/tutorial001.py!}
    ```
    
    !!! note "技术细节"
    
        `Request` 的 `request.scope` 属性是包含关联请求元数据的字典。
    
        `Request` 的 `request.receive` 方法是**接收**请求体的函数。
    
        `scope` 字典与 `receive` 函数都是 ASGI 规范的内容。
    
        `scope` 与 `receive` 也是创建新的 `Request` 实例所需的。
    
        `Request` 的更多内容详见 <a href="https://www.starlette.io/requests/" class="external-link" target="_blank">Starlette 官档 - 请求</a>。
    Plain Text
    - Registered: Sun Mar 31 07:19:09 GMT 2024
    - Last Modified: Sat Mar 30 22:45:40 GMT 2024
    - 3.8K bytes
    - Viewed (0)
Back to top