Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 74 for Method (0.17 sec)

  1. docs/en/docs/advanced/generate-clients.md

    But I'll show you how to improve that next. ๐Ÿค“
    
    ## Custom Operation IDs and Better Method Names
    
    You can **modify** the way these operation IDs are **generated** to make them simpler and have **simpler method names** in the clients.
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 10.5K bytes
    - Viewed (0)
  2. docs_src/generate_clients/tutorial004.js

        const openapiContent = JSON.parse(data)
    
        const paths = openapiContent.paths
        for (const pathKey of Object.keys(paths)) {
          const pathData = paths[pathKey]
          for (const method of Object.keys(pathData)) {
            const operation = pathData[method]
            if (operation.tags && operation.tags.length > 0) {
              const tag = operation.tags[0]
              const operationId = operation.operationId
              const toRemove = `${tag}-`
    JavaScript
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Mar 14 11:40:05 GMT 2024
    - 1K bytes
    - Viewed (0)
  3. fastapi/utils.py

        operation_id = f"{operation_id}_{method.lower()}"
        return operation_id
    
    
    def generate_unique_id(route: "APIRoute") -> str:
        operation_id = f"{route.name}{route.path_format}"
        operation_id = re.sub(r"\W", "_", operation_id)
        assert route.methods
        operation_id = f"{operation_id}_{list(route.methods)[0].lower()}"
        return operation_id
    
    
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 7.8K bytes
    - Viewed (0)
  4. docs/en/docs/tutorial/first-steps.md

    "Operation" here refers to one of the HTTP "methods".
    
    One of:
    
    * `POST`
    * `GET`
    * `PUT`
    * `DELETE`
    
    ...and the more exotic ones:
    
    * `OPTIONS`
    * `HEAD`
    * `PATCH`
    * `TRACE`
    
    In the HTTP protocol, you can communicate to each path using one (or more) of these "methods".
    
    ---
    
    When building APIs, you normally use these specific HTTP methods to perform a specific action.
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu May 02 22:37:31 GMT 2024
    - 12K bytes
    - Viewed (0)
  5. docs/en/docs/how-to/custom-request-and-route.md

    ```
    
    ### Create a custom `GzipRoute` class
    
    Next, we create a custom subclass of `fastapi.routing.APIRoute` that will make use of the `GzipRequest`.
    
    This time, it will overwrite the method `APIRoute.get_route_handler()`.
    
    This method returns a function. And that function is what will receive a request and return a response.
    
    Here we use it to create a `GzipRequest` from the original request.
    
    ```Python hl_lines="18-26"
    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)
  6. docs/en/docs/tutorial/response-model.md

        ```
    
    === "Python 3.8+"
    
        ```Python hl_lines="17  22  24-27"
        {!> ../../../docs_src/response_model/tutorial001.py!}
        ```
    
    !!! note
        Notice that `response_model` is a parameter of the "decorator" method (`get`, `post`, etc). Not of your *path operation function*, like all the parameters and body.
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 17.9K bytes
    - Viewed (0)
  7. docs/em/docs/tutorial/first-steps.md

    #### ๐Ÿ”ฌ *โžก ๐Ÿ› ๏ธ ๐Ÿ‘จโ€๐ŸŽจ*
    
    ```Python hl_lines="6"
    {!../../../docs_src/first_steps/tutorial001.py!}
    ```
    
    `@app.get("/")` ๐Ÿ’ฌ **FastAPI** ๐Ÿ‘ˆ ๐Ÿ”ข โ–ถ๏ธ๏ธ ๐Ÿ”› ๐Ÿˆš ๐Ÿšš ๐Ÿ“จ ๐Ÿ‘ˆ ๐Ÿšถ:
    
    * โžก `/`
    * โš™๏ธ <abbr title="an HTTP GET method"><code>get</code> ๐Ÿ› ๏ธ</abbr>
    
    !!! info "`@decorator` โ„น"
        ๐Ÿ‘ˆ `@something` โ• ๐Ÿ ๐Ÿค™ "๐Ÿ‘จโ€๐ŸŽจ".
    
        ๐Ÿ‘† ๐Ÿšฎ โšซ๏ธ ๐Ÿ”› ๐Ÿ” ๐Ÿ”ข. ๐Ÿ’– ๐Ÿ“ถ ๐Ÿ“” ๐Ÿ‘’ (๐Ÿ‘ค ๐Ÿ’ญ ๐Ÿ‘ˆ ๐ŸŒโ” โš– ๐Ÿ‘Ÿ โšช๏ธโžก๏ธ).
    
         "๐Ÿ‘จโ€๐ŸŽจ" โœŠ ๐Ÿ”ข ๐Ÿ”› &amp; ๐Ÿ”จ ๐Ÿ•ณ โฎ๏ธ โšซ๏ธ.
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 8.1K bytes
    - Viewed (0)
  8. docs/ja/docs/tutorial/first-steps.md

    #### *ใƒ‘ใ‚นใ‚ชใƒšใƒฌใƒผใ‚ทใƒงใƒณใƒ‡ใ‚ณใƒฌใƒผใ‚ฟ*ใ‚’ๅฎš็พฉ
    
    ```Python hl_lines="6"
    {!../../../docs_src/first_steps/tutorial001.py!}
    ```
    `@app.get("/")`ใฏ็›ดไธ‹ใฎ้–ขๆ•ฐใŒไธ‹่จ˜ใฎใƒชใ‚ฏใ‚จใ‚นใƒˆใฎๅ‡ฆ็†ใ‚’ๆ‹…ๅฝ“ใ™ใ‚‹ใ“ใจใ‚’**FastAPI**ใซไผใˆใพใ™:
    
    * ใƒ‘ใ‚น `/`
    * <abbr title="an HTTP GET method"><code>get</code> ใ‚ชใƒšใƒฌใƒผใ‚ทใƒงใƒณ</abbr>
    
    !!! info "`@decorator` ใซใคใ„ใฆ"
        PythonใซใŠใ‘ใ‚‹`@something`ใ‚ทใƒณใ‚ฟใƒƒใ‚ฏใ‚นใฏใƒ‡ใ‚ณใƒฌใƒผใ‚ฟใจๅ‘ผใฐใ‚Œใพใ™ใ€‚
    
        ใ€Œใƒ‡ใ‚ณใƒฌใƒผใ‚ฟใ€ใฏ้–ขๆ•ฐใฎไธŠใซ็ฝฎใใพใ™ใ€‚ใ‹ใ‚ใ„ใ‚‰ใ—ใ„่ฃ…้ฃพ็š„ใชๅธฝๅญใฎใ‚ˆใ†ใงใ™๏ผˆใ“ใฎ็”จ่ชžใฎ็”ฑๆฅใฏใใ“ใซใ‚ใ‚‹ใจๆ€ใ„ใพใ™๏ผ‰ใ€‚
    
        ใ€Œใƒ‡ใ‚ณใƒฌใƒผใ‚ฟใ€ใฏ็›ดไธ‹ใฎ้–ขๆ•ฐใ‚’ๅ—ใ‘ๅ–ใ‚Šใ€ใใ‚Œใ‚’ไฝฟใฃใฆไฝ•ใ‹ใ‚’่กŒใ„ใพใ™ใ€‚
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 11.2K bytes
    - Viewed (0)
  9. docs/en/docs/alternatives.md

    def read_url():
        return {"message": "Hello World"}
    ```
    
    See the similarities in `requests.get(...)` and `@app.get(...)`.
    
    !!! check "Inspired **FastAPI** to"
        * Have a simple and intuitive API.
        * Use HTTP method names (operations) directly, in a straightforward and intuitive way.
        * Have sensible defaults, but powerful customizations.
    
    
    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)
  10. docs/en/docs/how-to/async-sql-encode-databases.md

    ## Create notes
    
    Create the *path operation function* to create notes:
    
    ```Python hl_lines="61-65"
    {!../../../docs_src/async_sql_databases/tutorial001.py!}
    ```
    
    !!! info
        In Pydantic v1 the method was called `.dict()`, it was deprecated (but still supported) in Pydantic v2, and renamed to `.model_dump()`.
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 5.3K bytes
    - Viewed (0)
Back to top