Search Options

Results per page
Sort
Preferred Languages
Advance

Results 51 - 60 of 158 for function (0.15 sec)

  1. 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)
  2. docs/en/docs/advanced/testing-dependencies.md

    For these cases, your **FastAPI** application has an attribute `app.dependency_overrides`, it is a simple `dict`.
    
    To override a dependency for testing, you put as a key the original dependency (a function), and as the value, your dependency override (another function).
    
    And then **FastAPI** will call that override instead of the original dependency.
    
    === "Python 3.10+"
    
        ```Python hl_lines="26-27  30"
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Tue Oct 17 05:59:11 GMT 2023
    - 2.9K bytes
    - Viewed (0)
  3. docs/fr/docs/tutorial/path-params.md

    ```Python hl_lines="6  11"
    {!../../../docs_src/path_params/tutorial003.py!}
    ```
    
    Sinon, le chemin `/users/{user_id}` correspondrait aussi à `/users/me`, la fonction "croyant" qu'elle a reçu un paramètre `user_id` avec pour valeur `"me"`.
    
    ## Valeurs prédéfinies
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 10K bytes
    - Viewed (0)
  4. docs/ja/docs/features.md

    型を使用した標準的なPythonを記述します:
    
    ```Python
    from datetime import date
    
    from pydantic import BaseModel
    
    # Declare a variable as a str
    # and get editor support inside the function
    def main(user_id: str):
        return user_id
    
    
    # A Pydantic model
    class User(BaseModel):
        id: int
        name: str
        joined: date
    ```
    
    これは以下のように用いられます:
    
    ```Python
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 12.3K bytes
    - Viewed (0)
  5. docs/en/docs/tutorial/response-status-code.md

    ```Python hl_lines="6"
    {!../../../docs_src/response_status_code/tutorial001.py!}
    ```
    
    !!! note
        Notice that `status_code` is a parameter of the "decorator" method (`get`, `post`, etc). Not of your *path operation function*, like all the parameters and body.
    
    The `status_code` parameter receives a number with the HTTP status code.
    
    !!! info
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat Aug 29 14:02:58 GMT 2020
    - 4K bytes
    - Viewed (0)
  6. docs/zh/docs/advanced/settings.md

    sequenceDiagram
    
    participant code as Code
    participant function as say_hi()
    participant execute as Execute function
    
        rect rgba(0, 255, 0, .1)
            code ->> function: say_hi(name="Camila")
            function ->> execute: 执行函数代码
            execute ->> code: 返回结果
        end
    
        rect rgba(0, 255, 255, .1)
            code ->> function: say_hi(name="Camila")
            function ->> code: 返回存储的结果
        end
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Mar 22 01:42:11 GMT 2024
    - 13.9K bytes
    - Viewed (0)
  7. docs/en/docs/tutorial/dependencies/classes-as-dependencies.md

    The key factor is that a dependency should be a "callable".
    
    A "**callable**" in Python is anything that Python can "call" like a function.
    
    So, if you have an object `something` (that might _not_ be a function) and you can "call" it (execute it) like:
    
    ```Python
    something()
    ```
    
    or
    
    ```Python
    something(some_argument, some_keyword_argument="foo")
    ```
    
    then it is a "callable".
    
    ## Classes as dependencies
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 11.4K bytes
    - Viewed (0)
  8. docs/de/docs/tutorial/first-steps.md

    ### Schritt 4: Definieren der **Pfadoperation-Funktion**
    
    Das ist unsere „**Pfadoperation-Funktion**“:
    
    * **Pfad**: ist `/`.
    * **Operation**: ist `get`.
    * **Funktion**: ist die Funktion direkt unter dem „Dekorator“ (unter `@app.get("/")`).
    
    ```Python hl_lines="7"
    {!../../../docs_src/first_steps/tutorial001.py!}
    ```
    
    Dies ist eine Python-Funktion.
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat Jan 13 12:16:22 GMT 2024
    - 10.5K bytes
    - Viewed (0)
  9. docs/de/docs/tutorial/middleware.md

    ## Erstellung einer Middleware
    
    Um eine Middleware zu erstellen, verwenden Sie den Dekorator `@app.middleware("http")` über einer Funktion.
    
    Die Middleware-Funktion erhält:
    
    * Den `request`.
    * Eine Funktion `call_next`, die den `request` als Parameter erhält.
        * Diese Funktion gibt den `request` an die entsprechende *Pfadoperation* weiter.
        * Dann gibt es die von der entsprechenden *Pfadoperation* generierte `response` zurück.
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Tue Jan 23 11:26:59 GMT 2024
    - 3.4K bytes
    - Viewed (0)
  10. docs/en/docs/tutorial/testing.md

    !!! tip
        If you want to call `async` functions in your tests apart from sending requests to your FastAPI application (e.g. asynchronous database functions), have a look at the [Async Tests](../advanced/async-tests.md){.internal-link target=_blank} in the advanced tutorial.
    
    ## Separating tests
    
    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)
Back to top