Search Options

Results per page
Sort
Preferred Languages
Advance

Results 111 - 120 of 1,800 for App (0.02 sec)

  1. docs/zh-hant/docs/tutorial/first-steps.md

    一個「裝飾器」會對下面的函式做一些事情。
    
    在這種情況下,這個裝飾器告訴 **FastAPI** 那個函式對應於 **路徑** `/` 和 **操作** `get`.
    
    這就是「**路徑操作裝飾器**」。
    
    ///
    
    你也可以使用其他的操作:
    
    * `@app.post()`
    * `@app.put()`
    * `@app.delete()`
    
    以及更少見的:
    
    * `@app.options()`
    * `@app.head()`
    * `@app.patch()`
    * `@app.trace()`
    
    /// tip
    
    你可以自由地使用每個操作(HTTP 方法)。
    
    **FastAPI** 不強制任何特定的意義。
    
    這裡的資訊作為一個指南,而不是要求。
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Oct 11 17:48:49 UTC 2025
    - 11.6K bytes
    - Viewed (0)
  2. docs/ko/docs/tutorial/first-steps.md

    이것이 "**경로 작동 데코레이터**"입니다.
    
    ///
    
    다른 작동도 사용할 수 있습니다:
    
    * `@app.post()`
    * `@app.put()`
    * `@app.delete()`
    
    흔히 사용되지 않는 것들도 있습니다:
    
    * `@app.options()`
    * `@app.head()`
    * `@app.patch()`
    * `@app.trace()`
    
    /// tip | 팁
    
    각 작동(HTTP 메소드)을 원하는 대로 사용해도 됩니다.
    
    **FastAPI**는 특정 의미를 강제하지 않습니다.
    
    여기서 정보는 지침서일뿐 강제사항이 아닙니다.
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Oct 11 17:48:49 UTC 2025
    - 10.3K bytes
    - Viewed (0)
  3. docs_src/request_files/tutorial001_03_py39.py

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

    import http
    
    from fastapi import FastAPI
    from fastapi.testclient import TestClient
    
    
    def test_no_content():
        app = FastAPI()
    
        @app.get("/no-content", status_code=http.HTTPStatus.NO_CONTENT)
        def return_no_content() -> "None":
            return
    
        client = TestClient(app)
        response = client.get("/no-content")
        assert response.status_code == http.HTTPStatus.NO_CONTENT, response.text
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Sep 20 18:44:43 UTC 2025
    - 431 bytes
    - Viewed (0)
  5. docs_src/bigger_applications/app_py39/main.py

    from .internal import admin
    from .routers import items, users
    
    app = FastAPI(dependencies=[Depends(get_query_token)])
    
    
    app.include_router(users.router)
    app.include_router(items.router)
    app.include_router(
        admin.router,
        prefix="/admin",
        tags=["admin"],
        dependencies=[Depends(get_token_header)],
        responses={418: {"description": "I'm a teapot"}},
    )
    
    
    @app.get("/")
    async def root():
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 552 bytes
    - Viewed (0)
  6. docs/zh/docs/tutorial/testing.md

    在实际应用中,你可能会把你的测试放在另一个文件里。
    
    您的**FastAPI**应用程序也可能由一些文件/模块组成等等。
    
    ### **FastAPI** app 文件
    
    假设你有一个像 [更大的应用](bigger-applications.md){.internal-link target=_blank} 中所描述的文件结构:
    
    ```
    .
    ├── app
    │   ├── __init__.py
    │   └── main.py
    ```
    
    在 `main.py` 文件中你有一个 **FastAPI** app:
    
    
    {* ../../docs_src/app_testing/main.py *}
    
    ### 测试文件
    
    然后你会有一个包含测试的文件 `test_main.py` 。app可以像Python包那样存在(一样是目录,但有个 `__init__.py` 文件):
    
    ``` hl_lines="5"
    .
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Oct 11 17:48:49 UTC 2025
    - 5.9K bytes
    - Viewed (0)
  7. tests/test_tutorial/test_events/test_tutorial002.py

    import pytest
    from fastapi import FastAPI
    from fastapi.testclient import TestClient
    
    
    @pytest.fixture(name="app", scope="module")
    def get_app():
        with pytest.warns(DeprecationWarning):
            from docs_src.events.tutorial002_py39 import app
        yield app
    
    
    def test_events(app: FastAPI):
        with TestClient(app) as client:
            response = client.get("/items/")
            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)
  8. tests/test_security_oauth2_authorization_code_bearer_scopes_openapi.py

        return token
    
    
    app = FastAPI(dependencies=[Depends(get_token)])
    
    
    @app.get("/")
    async def root():
        return {"message": "Hello World"}
    
    
    @app.get(
        "/with-oauth2-scheme",
        dependencies=[Security(oauth2_scheme, scopes=["read", "write"])],
    )
    async def read_with_oauth2_scheme():
        return {"message": "Admin Access"}
    
    
    @app.get(
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 21:25:59 UTC 2025
    - 6.6K bytes
    - Viewed (0)
  9. docs_src/generate_clients/tutorial001_py39.py

    from fastapi import FastAPI
    from pydantic import BaseModel
    
    app = FastAPI()
    
    
    class Item(BaseModel):
        name: str
        price: float
    
    
    class ResponseMessage(BaseModel):
        message: str
    
    
    @app.post("/items/", response_model=ResponseMessage)
    async def create_item(item: Item):
        return {"message": "item received"}
    
    
    @app.get("/items/", response_model=list[Item])
    async def get_items():
        return [
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Fri Mar 04 22:02:18 UTC 2022
    - 494 bytes
    - Viewed (0)
  10. docs/uk/docs/tutorial/first-steps.md

    Це і є "декоратор операції шляху (path operation decorator)".
    
    ///
    
    Можна також використовувати операції:
    
    * `@app.post()`
    * `@app.put()`
    * `@app.delete()`
    
    І більш екзотичні:
    
    * `@app.options()`
    * `@app.head()`
    * `@app.patch()`
    * `@app.trace()`
    
    /// tip | Порада
    
    Ви можете використовувати кожну операцію (HTTP-метод) на свій розсуд.
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Oct 11 17:48:49 UTC 2025
    - 15.5K bytes
    - Viewed (0)
Back to top