Search Options

Results per page
Sort
Preferred Languages
Advance

Results 451 - 460 of 2,056 for app (0.02 sec)

  1. tests/test_response_model_sub_types.py

    
    class Model(BaseModel):
        name: str
    
    
    app = FastAPI()
    
    
    @app.get("/valid1", responses={"500": {"model": int}})
    def valid1():
        pass
    
    
    @app.get("/valid2", responses={"500": {"model": List[int]}})
    def valid2():
        pass
    
    
    @app.get("/valid3", responses={"500": {"model": Model}})
    def valid3():
        pass
    
    
    @app.get("/valid4", responses={"500": {"model": List[Model]}})
    def valid4():
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri Jun 30 18:25:16 UTC 2023
    - 5.3K bytes
    - Viewed (0)
  2. docs_src/security/tutorial005_py39.py

            expires_delta=access_token_expires,
        )
        return Token(access_token=access_token, token_type="bearer")
    
    
    @app.get("/users/me/", response_model=User)
    async def read_users_me(current_user: User = Depends(get_current_active_user)):
        return current_user
    
    
    @app.get("/users/me/items/")
    async def read_own_items(
        current_user: User = Security(get_current_active_user, scopes=["items"]),
    ):
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Mon May 20 17:37:28 UTC 2024
    - 5.2K bytes
    - Viewed (0)
  3. docs_src/path_operation_configuration/tutorial002_py310.py

    from fastapi import FastAPI
    from pydantic import BaseModel
    
    app = FastAPI()
    
    
    class Item(BaseModel):
        name: str
        description: str | None = None
        price: float
        tax: float | None = None
        tags: set[str] = set()
    
    
    @app.post("/items/", response_model=Item, tags=["items"])
    async def create_item(item: Item):
        return item
    
    
    @app.get("/items/", tags=["items"])
    async def read_items():
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri Jan 07 14:11:31 UTC 2022
    - 537 bytes
    - Viewed (0)
  4. docs/em/docs/advanced/testing-dependencies.md

    ๐Ÿ‘† ๐ŸŽฒ ๐Ÿ’š ๐Ÿ’ฏ ๐Ÿ”ข ๐Ÿ•โ€๐Ÿฆบ ๐Ÿ•, โœ‹๏ธ ๐Ÿšซ ๐ŸŽฏ ๐Ÿค™ โšซ๏ธ ๐Ÿ”  ๐Ÿ’ฏ ๐Ÿ‘ˆ ๐Ÿƒ.
    
    ๐Ÿ‘‰ ๐Ÿ’ผ, ๐Ÿ‘† ๐Ÿ’ช ๐Ÿ” ๐Ÿ”— ๐Ÿ‘ˆ ๐Ÿค™ ๐Ÿ‘ˆ ๐Ÿ•โ€๐Ÿฆบ, & โš™๏ธ ๐Ÿ›ƒ ๐Ÿ”— ๐Ÿ‘ˆ ๐Ÿ“จ ๐ŸŽ ๐Ÿ‘ฉโ€๐Ÿ’ป, ๐Ÿ•ด ๐Ÿ‘† ๐Ÿ’ฏ.
    
    ### โš™๏ธ `app.dependency_overrides` ๐Ÿ”ข
    
    ๐Ÿ‘ซ ๐Ÿ’ผ, ๐Ÿ‘† **FastAPI** ๐Ÿˆธ โœ”๏ธ ๐Ÿ”ข `app.dependency_overrides`, โšซ๏ธ ๐Ÿ™… `dict`.
    
    ๐Ÿ” ๐Ÿ”— ๐Ÿ”ฌ, ๐Ÿ‘† ๐Ÿšฎ ๐Ÿ”‘ โฎ๏ธ ๐Ÿ”— (๐Ÿ”ข), & ๐Ÿ’ฒ, ๐Ÿ‘† ๐Ÿ”— ๐Ÿ” (โž•1๏ธโƒฃ ๐Ÿ”ข).
    
    & โคด๏ธ **FastAPI** ๐Ÿ”œ ๐Ÿค™ ๐Ÿ‘ˆ ๐Ÿ” โ†ฉ๏ธ โฎ๏ธ ๐Ÿ”—.
    
    ```Python hl_lines="28-29  32"
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 1.7K bytes
    - Viewed (0)
  5. tests/test_additional_responses_default_validationerror.py

    from fastapi import FastAPI
    from fastapi.testclient import TestClient
    
    app = FastAPI()
    
    
    @app.get("/a/{id}")
    async def a(id):
        pass  # pragma: no cover
    
    
    client = TestClient(app)
    
    
    def test_openapi_schema():
        response = client.get("/openapi.json")
        assert response.status_code == 200, response.text
        assert response.json() == {
            "openapi": "3.1.0",
            "info": {"title": "FastAPI", "version": "0.1.0"},
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri Jun 30 18:25:16 UTC 2023
    - 2.8K bytes
    - Viewed (0)
  6. tests/test_duplicate_models_openapi.py

    from fastapi.testclient import TestClient
    from pydantic import BaseModel
    
    app = FastAPI()
    
    
    class Model(BaseModel):
        pass
    
    
    class Model2(BaseModel):
        a: Model
    
    
    class Model3(BaseModel):
        c: Model
        d: Model2
    
    
    @app.get("/", response_model=Model3)
    def f():
        return {"c": {}, "d": {"a": {}}}
    
    
    client = TestClient(app)
    
    
    def test_get_api_route():
        response = client.get("/")
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri Jun 30 18:25:16 UTC 2023
    - 2.1K bytes
    - Viewed (0)
  7. docs/ko/docs/tutorial/response-status-code.md

    # ์‘๋‹ต ์ƒํƒœ ์ฝ”๋“œ
    
    ์‘๋‹ต ๋ชจ๋ธ๊ณผ ๊ฐ™์€ ๋ฐฉ๋ฒ•์œผ๋กœ, ์–ด๋–ค *๊ฒฝ๋กœ ์ž‘๋™*์ด๋“  `status_code` ๋งค๊ฐœ๋ณ€์ˆ˜๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ์‘๋‹ต์— ๋Œ€ํ•œ HTTP ์ƒํƒœ ์ฝ”๋“œ๋ฅผ ์„ ์–ธํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
    
    * `@app.get()`
    * `@app.post()`
    * `@app.put()`
    * `@app.delete()`
    * ๊ธฐํƒ€
    
    ```Python hl_lines="6"
    {!../../docs_src/response_status_code/tutorial001.py!}
    ```
    
    /// note | "์ฐธ๊ณ "
    
    `status_code` ๋Š” "๋ฐ์ฝ”๋ ˆ์ดํ„ฐ" ๋ฉ”์†Œ๋“œ(`get`, `post` ๋“ฑ)์˜ ๋งค๊ฐœ๋ณ€์ˆ˜์ž…๋‹ˆ๋‹ค. ๋ชจ๋“  ๋งค๊ฐœ๋ณ€์ˆ˜๋“ค๊ณผ ๋ณธ๋ฌธ์ฒ˜๋Ÿผ *๊ฒฝ๋กœ ์ž‘๋™ ํ•จ์ˆ˜*๊ฐ€ ์•„๋‹™๋‹ˆ๋‹ค.
    
    ///
    
    `status_code` ๋งค๊ฐœ๋ณ€์ˆ˜๋Š” HTTP ์ƒํƒœ ์ฝ”๋“œ๋ฅผ ์ˆซ์ž๋กœ ์ž…๋ ฅ๋ฐ›์Šต๋‹ˆ๋‹ค.
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 4.8K bytes
    - Viewed (0)
  8. tests/test_tutorial/test_behind_a_proxy/test_tutorial002.py

    from fastapi.testclient import TestClient
    
    from docs_src.behind_a_proxy.tutorial002 import app
    
    client = TestClient(app)
    
    
    def test_main():
        response = client.get("/app")
        assert response.status_code == 200
        assert response.json() == {"message": "Hello World", "root_path": "/api/v1"}
    
    
    def test_openapi():
        response = client.get("/openapi.json")
        assert response.status_code == 200
        assert response.json() == {
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri Jun 30 18:25:16 UTC 2023
    - 1K bytes
    - Viewed (0)
  9. docs/em/docs/tutorial/debugging.md

    </div>
    
    โœ‹๏ธ ๐Ÿšซ ๐Ÿค™ ๐Ÿ•โ” โž•1๏ธโƒฃ ๐Ÿ“ ๐Ÿ—„ โšซ๏ธ, ๐Ÿ’–:
    
    ```Python
    from myapp import app
    ```
    
    #### ๐ŸŒ… โ„น
    
    โžก๏ธ ๐Ÿ’ฌ ๐Ÿ‘† ๐Ÿ“ ๐ŸŒŸ `myapp.py`.
    
    ๐Ÿšฅ ๐Ÿ‘† ๐Ÿƒ โšซ๏ธ โฎ๏ธ:
    
    <div class="termy">
    
    ```console
    $ python myapp.py
    ```
    
    </div>
    
    โคด๏ธ ๐Ÿ”— ๐Ÿ”ข `__name__` ๐Ÿ‘† ๐Ÿ“, โœ ๐Ÿ” ๐Ÿ, ๐Ÿ”œ โœ”๏ธ ๐Ÿ’ฒ ๐ŸŽป `"__main__"`.
    
    , ๐Ÿ“„:
    
    ```Python
        uvicorn.run(app, host="0.0.0.0", port=8000)
    ```
    
    ๐Ÿ”œ ๐Ÿƒ.
    
    ---
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 2.1K bytes
    - Viewed (0)
  10. docs/de/docs/tutorial/first-steps.md

    Dies ist der โ€ž**Pfadoperation-Dekorator**โ€œ.
    
    ///
    
    Sie kรถnnen auch die anderen Operationen verwenden:
    
    * `@app.post()`
    * `@app.put()`
    * `@app.delete()`
    
    Oder die exotischeren:
    
    * `@app.options()`
    * `@app.head()`
    * `@app.patch()`
    * `@app.trace()`
    
    /// tip | "Tipp"
    
    Es steht Ihnen frei, jede Operation (HTTP-Methode) so zu verwenden, wie Sie es mรถchten.
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 10.5K bytes
    - Viewed (0)
Back to top