Search Options

Results per page
Sort
Preferred Languages
Advance

Results 131 - 140 of 1,926 for App (0.01 sec)

  1. docs_src/request_files/tutorial001_py39.py

    from fastapi import FastAPI, File, UploadFile
    
    app = FastAPI()
    
    
    @app.post("/files/")
    async def create_file(file: bytes = File()):
        return {"file_size": len(file)}
    
    
    @app.post("/uploadfile/")
    async def create_upload_file(file: UploadFile):
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 282 bytes
    - Viewed (0)
  2. tests/test_tutorial/test_request_files/test_tutorial002.py

    
    @pytest.fixture(
        name="app",
        params=[
            "tutorial002_py39",
            "tutorial002_an_py39",
        ],
    )
    def get_app(request: pytest.FixtureRequest):
        mod = importlib.import_module(f"docs_src.request_files.{request.param}")
    
        return mod.app
    
    
    @pytest.fixture(name="client")
    def get_client(app: FastAPI):
        client = TestClient(app)
        return client
    
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 18:19:10 UTC 2025
    - 8.2K bytes
    - Viewed (0)
  3. CLAUDE.md

    ## Key Patterns
    
    ### Actions (Controllers)
    - Located in `app.web.*` or `app.web.admin.*`
    - Methods with `@Execute` are web endpoints
    - DI via `@Resource` annotation
    - `HtmlResponse` for JSP, `JsonResponse` for APIs
    
    ### Services
    - Business logic in `app.service.*`
    - Injected into Actions
    - Use behavior classes to access OpenSearch
    
    ### Helpers
    Registered: Sat Dec 20 09:19:18 UTC 2025
    - Last Modified: Fri Nov 28 16:29:12 UTC 2025
    - 4.8K bytes
    - Viewed (0)
  4. tests/test_dependency_contextvars.py

        "legacy_request_state_context_var", default=None
    )
    
    app = FastAPI()
    
    
    async def set_up_request_state_dependency():
        request_state = {"user": "deadpond"}
        contextvar_token = legacy_request_state_context_var.set(request_state)
        yield request_state
        legacy_request_state_context_var.reset(contextvar_token)
    
    
    @app.middleware("http")
    async def custom_middleware(
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 21:25:59 UTC 2025
    - 1.5K bytes
    - Viewed (0)
  5. tests/test_tutorial/test_dependencies/test_tutorial008c.py

        return mod
    
    
    def test_get_no_item(mod: ModuleType):
        client = TestClient(mod.app)
        response = client.get("/items/foo")
        assert response.status_code == 404, response.text
        assert response.json() == {"detail": "Item not found, there's only a plumbus here"}
    
    
    def test_get(mod: ModuleType):
        client = TestClient(mod.app)
        response = client.get("/items/plumbus")
        assert response.status_code == 200, response.text
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 1.4K bytes
    - Viewed (0)
  6. tests/test_modules_same_name_body/app/main.py

    from fastapi import FastAPI
    
    from . import a, b
    
    app = FastAPI()
    
    app.include_router(a.router, prefix="/a")
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Fri Jun 28 17:35:16 UTC 2019
    - 150 bytes
    - Viewed (0)
  7. tests/test_response_code_no_body.py

    from fastapi.testclient import TestClient
    from pydantic import BaseModel
    
    app = FastAPI()
    
    
    class JsonApiResponse(JSONResponse):
        media_type = "application/vnd.api+json"
    
    
    class Error(BaseModel):
        status: str
        title: str
    
    
    class JsonApiError(BaseModel):
        errors: list[Error]
    
    
    @app.get(
        "/a",
        status_code=204,
        response_class=JsonApiResponse,
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 21:25:59 UTC 2025
    - 3.2K bytes
    - Viewed (0)
  8. docs/pt/docs/tutorial/sql-databases.md

    <div class="screenshot">
    <img src="/img/tutorial/sql-databases/image01.png">
    </div>
    
    ## Atualizar o App com Múltiplos Modelos { #update-the-app-with-multiple-models }
    
    Agora vamos **refatorar** este app um pouco para aumentar a **segurança** e **versatilidade**.
    
    Se você verificar o app anterior, na interface você pode ver que, até agora, ele permite que o cliente decida o `id` do `Hero` a ser criado. 😱
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Tue Dec 16 20:32:40 UTC 2025
    - 16.9K bytes
    - Viewed (0)
  9. docs_src/advanced_middleware/tutorial003_py39.py

    from fastapi import FastAPI
    from fastapi.middleware.gzip import GZipMiddleware
    
    app = FastAPI()
    
    app.add_middleware(GZipMiddleware, minimum_size=1000, compresslevel=5)
    
    
    @app.get("/")
    async def main():
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 230 bytes
    - Viewed (0)
  10. docs_src/path_operation_configuration/tutorial002b_py39.py

    from enum import Enum
    
    from fastapi import FastAPI
    
    app = FastAPI()
    
    
    class Tags(Enum):
        items = "items"
        users = "users"
    
    
    @app.get("/items/", tags=[Tags.items])
    async def get_items():
        return ["Portal gun", "Plumbus"]
    
    
    @app.get("/users/", tags=[Tags.users])
    async def read_users():
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 323 bytes
    - Viewed (0)
Back to top