Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 70 for define (0.19 sec)

  1. docs/en/docs/reference/websockets.md

    It is provided directly by Starlette, but you can import it from `fastapi`:
    
    ```python
    from fastapi import WebSocket
    ```
    
    !!! tip
        When you want to define dependencies that should be compatible with both HTTP and WebSockets, you can define a parameter that takes an `HTTPConnection` instead of a `Request` or a `WebSocket`.
    
    ::: fastapi.WebSocket
        options:
            members:
                - scope
                - app
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 1.6K bytes
    - Viewed (0)
  2. docs/en/docs/tutorial/request-forms-and-files.md

    # Request Forms and Files
    
    You can define files and form fields at the same time using `File` and `Form`.
    
    !!! info
        To receive uploaded files and/or form data, first install <a href="https://github.com/Kludex/python-multipart" class="external-link" target="_blank">`python-multipart`</a>.
    
        E.g. `pip install python-multipart`.
    
    ## Import `File` and `Form`
    
    === "Python 3.9+"
    
        ```Python hl_lines="3"
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Wed Mar 13 19:02:19 GMT 2024
    - 2K bytes
    - Viewed (0)
  3. docs/en/docs/advanced/events.md

    # Lifespan Events
    
    You can define logic (code) that should be executed before the application **starts up**. This means that this code will be executed **once**, **before** the application **starts receiving requests**.
    
    The same way, you can define logic (code) that should be executed when the application is **shutting down**. In this case, this code will be executed **once**, **after** having handled possibly **many requests**.
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 7.8K bytes
    - Viewed (0)
  4. docs/en/docs/reference/uploadfile.md

    # `UploadFile` class
    
    You can define *path operation function* parameters to be of the type `UploadFile` to receive files from the request.
    
    You can import it directly from `fastapi`:
    
    ```python
    from fastapi import UploadFile
    ```
    
    ::: fastapi.UploadFile
        options:
            members:
                - file
                - filename
                - size
                - headers
                - content_type
                - read
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 472 bytes
    - Viewed (0)
  5. fastapi/security/api_key.py

        """
        API key authentication using a query parameter.
    
        This defines the name of the query parameter that should be provided in the request
        with the API key and integrates that into the OpenAPI documentation. It extracts
        the key value sent in the query parameter automatically and provides it as the
        dependency result. But it doesn't define how to send that API key to the client.
    
        ## Usage
    
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Tue Apr 23 22:29:18 GMT 2024
    - 9.1K bytes
    - Viewed (0)
  6. docs/en/docs/reference/request.md

    You can import it directly from `fastapi`:
    
    ```python
    from fastapi import Request
    ```
    
    !!! tip
        When you want to define dependencies that should be compatible with both HTTP and WebSockets, you can define a parameter that takes an `HTTPConnection` instead of a `Request` or a `WebSocket`.
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 516 bytes
    - Viewed (0)
  7. docs/en/docs/python-types.md

    If you can use the **latest versions of Python**, use the examples for the latest version, those will have the **best and simplest syntax**, for example, "**Python 3.10+**".
    
    #### List
    
    For example, let's define a variable to be a `list` of `str`.
    
    === "Python 3.9+"
    
        Declare the variable, with the same colon (`:`) syntax.
    
        As the type, put `list`.
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 17K bytes
    - Viewed (0)
  8. docs/en/docs/tutorial/security/first-steps.md

    **FastAPI** will know that it can use this dependency to define a "security scheme" in the OpenAPI schema (and the automatic API docs).
    
    !!! info "Technical Details"
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Wed Mar 13 19:02:19 GMT 2024
    - 8.9K bytes
    - Viewed (0)
  9. docs/en/docs/alternatives.md

    But it was created before there existed Python type hints. So, to define every <abbr title="the definition of how data should be formed">schema</abbr> you need to use specific utils and classes provided by Marshmallow.
    
    !!! check "Inspired **FastAPI** to"
        Use code to define "schemas" that provide data types and validation, automatically.
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 23.2K bytes
    - Viewed (0)
  10. docs/en/docs/how-to/nosql-databases-couchbase.md

    ## Import Couchbase components
    
    For now, don't pay attention to the rest, only the imports:
    
    ```Python hl_lines="3-5"
    {!../../../docs_src/nosql_databases/tutorial001.py!}
    ```
    
    ## Define a constant to use as a "document type"
    
    We will use it later as a fixed field `type` in our documents.
    
    This is not required by Couchbase, but is a good practice that will help you afterwards.
    
    ```Python hl_lines="9"
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Tue Jan 16 13:23:25 GMT 2024
    - 6K bytes
    - Viewed (0)
Back to top