Search Options

Results per page
Sort
Preferred Languages
Advance

Results 411 - 420 of 1,976 for Fastapi (0.08 sec)

  1. docs_src/query_params_str_validations/tutorial006c_an_py310.py

    from typing import Annotated
    
    from fastapi import FastAPI, Query
    
    app = FastAPI()
    
    
    @app.get("/items/")
    async def read_items(q: Annotated[str | None, Query(min_length=3)] = ...):
        results = {"items": [{"item_id": "Foo"}, {"item_id": "Bar"}]}
        if q:
            results.update({"q": q})
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sat Mar 18 12:29:59 UTC 2023
    - 307 bytes
    - Viewed (0)
  2. docs_src/request_files/tutorial001_an_py39.py

    from typing import Annotated
    
    from fastapi import FastAPI, File, UploadFile
    
    app = FastAPI()
    
    
    @app.post("/files/")
    async def create_file(file: Annotated[bytes, File()]):
        return {"file_size": len(file)}
    
    
    @app.post("/uploadfile/")
    async def create_upload_file(file: UploadFile):
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sat Mar 18 12:29:59 UTC 2023
    - 322 bytes
    - Viewed (0)
  3. docs_src/request_form_models/tutorial002_pv1_an.py

    from fastapi import FastAPI, Form
    from pydantic import BaseModel
    from typing_extensions import Annotated
    
    app = FastAPI()
    
    
    class FormData(BaseModel):
        username: str
        password: str
    
        class Config:
            extra = "forbid"
    
    
    @app.post("/login/")
    async def login(data: Annotated[FormData, Form()]):
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri Sep 06 17:31:18 UTC 2024
    - 322 bytes
    - Viewed (0)
  4. docs_src/response_directly/tutorial002.py

    from fastapi import FastAPI, Response
    
    app = FastAPI()
    
    
    @app.get("/legacy/")
    def get_legacy_data():
        data = """<?xml version="1.0"?>
        <shampoo>
        <Header>
            Apply shampoo here.
        </Header>
        <Body>
            You'll have to use soap here.
        </Body>
        </shampoo>
        """
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Thu Mar 26 19:09:53 UTC 2020
    - 354 bytes
    - Viewed (0)
  5. docs_src/path_params_numeric_validations/tutorial003.py

    from fastapi import FastAPI, Path
    
    app = FastAPI()
    
    
    @app.get("/items/{item_id}")
    async def read_items(*, item_id: int = Path(title="The ID of the item to get"), q: str):
        results = {"item_id": item_id}
        if q:
            results.update({"q": q})
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri May 13 23:38:22 UTC 2022
    - 268 bytes
    - Viewed (0)
  6. docs/en/docs/tutorial/request-files.md

    /// note | "`async` Technical Details"
    
    When you use the `async` methods, **FastAPI** runs the file methods in a threadpool and awaits for them.
    
    ///
    
    /// note | "Starlette Technical Details"
    
    **FastAPI**'s `UploadFile` inherits directly from **Starlette**'s `UploadFile`, but adds some necessary parts to make it compatible with **Pydantic** and the other parts of FastAPI.
    
    ///
    
    ## What is "Form Data"
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 10.2K bytes
    - Viewed (0)
  7. docs/pt/docs/advanced/response-headers.md

    **FastAPI** fornece as mesmas `starlette.responses` como `fastapi.responses` apenas como uma conveniência para você, desenvolvedor. Mas a maioria das respostas disponíveis vem diretamente do Starlette.
    
    E como a `Response` pode ser usada frequentemente para definir cabeçalhos e cookies, **FastAPI** também a fornece em `fastapi.Response`.
    
    ///
    
    ## Cabeçalhos personalizados
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Wed Oct 16 07:44:45 UTC 2024
    - 2.5K bytes
    - Viewed (0)
  8. docs/de/docs/advanced/templates.md

    # Templates
    
    Sie können jede gewünschte Template-Engine mit **FastAPI** verwenden.
    
    Eine häufige Wahl ist Jinja2, dasselbe, was auch von Flask und anderen Tools verwendet wird.
    
    Es gibt Werkzeuge zur einfachen Konfiguration, die Sie direkt in Ihrer **FastAPI**-Anwendung verwenden können (bereitgestellt von Starlette).
    
    ## Abhängigkeiten installieren
    
    Installieren Sie `jinja2`:
    
    <div class="termy">
    
    ```console
    $ pip install jinja2
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 3.6K bytes
    - Viewed (0)
  9. docs/pt/docs/advanced/templates.md

    # Templates
    
    Você pode usar qualquer template engine com o **FastAPI**.
    
    Uma escolha comum é o Jinja2, o mesmo usado pelo Flask e outras ferramentas.
    
    Existem utilitários para configurá-lo facilmente que você pode usar diretamente em sua aplicação **FastAPI** (fornecidos pelo Starlette).
    
    ## Instalação de dependências
    
    Para instalar o `jinja2`, siga o código abaixo:
    
    <div class="termy">
    
    ```console
    $ pip install jinja2
    ```
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 3.3K bytes
    - Viewed (0)
  10. fastapi/security/http.py

        Read more about it in the
        [FastAPI docs for HTTP Basic Auth](https://fastapi.tiangolo.com/advanced/security/http-basic-auth/).
    
        ## Example
    
        ```python
        from typing import Annotated
    
        from fastapi import Depends, FastAPI
        from fastapi.security import HTTPBasic, HTTPBasicCredentials
    
        app = FastAPI()
    
        security = HTTPBasic()
    
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Thu Sep 19 09:47:28 UTC 2024
    - 13.2K bytes
    - Viewed (0)
Back to top