Search Options

Results per page
Sort
Preferred Languages
Advance

Results 41 - 50 of 320 for posts (0.13 sec)

  1. docs_src/security/tutorial003_an_py39.py

        current_user: Annotated[User, Depends(get_current_user)],
    ):
        if current_user.disabled:
            raise HTTPException(status_code=400, detail="Inactive user")
        return current_user
    
    
    @app.post("/token")
    async def login(form_data: Annotated[OAuth2PasswordRequestForm, Depends()]):
        user_dict = fake_users_db.get(form_data.username)
        if not user_dict:
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Tue Mar 26 16:56:53 GMT 2024
    - 2.5K bytes
    - Viewed (0)
  2. tests/test_tutorial/test_schema_extra_example/test_tutorial001_pv1.py

    
    @pytest.fixture(name="client")
    def get_client():
        from docs_src.schema_extra_example.tutorial001_pv1 import app
    
        client = TestClient(app)
        return client
    
    
    @needs_pydanticv1
    def test_post_body_example(client: TestClient):
        response = client.put(
            "/items/5",
            json={
                "name": "Foo",
                "description": "A very nice Item",
                "price": 35.4,
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 4.4K bytes
    - Viewed (0)
  3. docs/em/docs/tutorial/request-files.md

        ๐Ÿšฅ ๐Ÿ‘† ๐Ÿ’š โœ ๐ŸŒ– ๐Ÿ”ƒ ๐Ÿ‘‰ ๐Ÿ”ข &amp; ๐Ÿ“จ ๐Ÿ‘, ๐Ÿ‘ณ <a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/POST" class="external-link" target="_blank"><abbr title="Mozilla Developer Network">๐Ÿ‡</abbr> ๐Ÿ•ธ ๐Ÿฉบ <code>POST</code></a>.
    
    !!! warning
        ๐Ÿ‘† ๐Ÿ’ช ๐Ÿ“ฃ ๐Ÿ’— `File` &amp; `Form` ๐Ÿ”ข *โžก ๐Ÿ› ๏ธ*, โœ‹๏ธ ๐Ÿ‘† ๐Ÿ’ช ๐Ÿšซ ๐Ÿ“ฃ `Body` ๐Ÿ‘ ๐Ÿ‘ˆ ๐Ÿ‘† โŒ› ๐Ÿ“จ ๐ŸŽป, ๐Ÿ“จ ๐Ÿ”œ โœ”๏ธ ๐Ÿ’ช ๐Ÿ—œ โš™๏ธ `multipart/form-data` โ†ฉ๏ธ `application/json`.
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Wed Mar 13 19:02:19 GMT 2024
    - 6.6K bytes
    - Viewed (0)
  4. docs/ko/docs/tutorial/request-files.md

        ํ•˜์ง€๋งŒ ํŒŒ์ผ์ด ํฌํ•จ๋œ ๊ฒฝ์šฐ, `multipart/form-data`๋กœ ์ธ์ฝ”๋”ฉ๋ฉ๋‹ˆ๋‹ค. `File`์„ ์‚ฌ์šฉํ•˜์˜€๋‹ค๋ฉด, **FastAPI**๋Š” ๋ณธ๋ฌธ์˜ ์ ํ•ฉํ•œ ๋ถ€๋ถ„์—์„œ ํŒŒ์ผ์„ ๊ฐ€์ ธ์™€์•ผ ํ•œ๋‹ค๋Š” ๊ฒƒ์„ ์ธ์ง€ํ•ฉ๋‹ˆ๋‹ค.
    
        ์ธ์ฝ”๋”ฉ๊ณผ ํผ ํ•„๋“œ์— ๋Œ€ํ•ด ๋” ์•Œ๊ณ ์‹ถ๋‹ค๋ฉด, <a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/POST" class="external-link" target="_blank"><code>POST</code>์— ๊ด€ํ•œ<abbr title="Mozilla Developer Network">MDN</abbr>์›น ๋ฌธ์„œ</a> ๋ฅผ ์ฐธ๊ณ ํ•˜๊ธฐ ๋ฐ”๋ž๋‹ˆ๋‹ค,.
    
    !!! warning "๊ฒฝ๊ณ "
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Wed Mar 13 19:02:19 GMT 2024
    - 8.1K bytes
    - Viewed (0)
  5. tests/test_tutorial/test_schema_extra_example/test_tutorial004_an_py310.py

        from docs_src.schema_extra_example.tutorial004_an_py310 import app
    
        client = TestClient(app)
        return client
    
    
    # Test required and embedded body parameters with no bodies sent
    @needs_py310
    def test_post_body_example(client: TestClient):
        response = client.put(
            "/items/5",
            json={
                "name": "Foo",
                "description": "A very nice Item",
                "price": 35.4,
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 7.1K bytes
    - Viewed (0)
  6. tests/test_tutorial/test_schema_extra_example/test_tutorial005_an.py

    
    @pytest.fixture(name="client")
    def get_client():
        from docs_src.schema_extra_example.tutorial005_an import app
    
        client = TestClient(app)
        return client
    
    
    def test_post_body_example(client: TestClient):
        response = client.put(
            "/items/5",
            json={
                "name": "Foo",
                "description": "A very nice Item",
                "price": 35.4,
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Aug 26 18:03:13 GMT 2023
    - 6.7K bytes
    - Viewed (0)
  7. docs_src/security/tutorial004.py

    async def get_current_active_user(current_user: User = Depends(get_current_user)):
        if current_user.disabled:
            raise HTTPException(status_code=400, detail="Inactive user")
        return current_user
    
    
    @app.post("/token")
    async def login_for_access_token(
        form_data: OAuth2PasswordRequestForm = Depends(),
    ) -> Token:
        user = authenticate_user(fake_users_db, form_data.username, form_data.password)
        if not user:
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Tue Mar 26 16:56:53 GMT 2024
    - 4K bytes
    - Viewed (0)
  8. docs_src/security/tutorial004_an.py

        current_user: Annotated[User, Depends(get_current_user)],
    ):
        if current_user.disabled:
            raise HTTPException(status_code=400, detail="Inactive user")
        return current_user
    
    
    @app.post("/token")
    async def login_for_access_token(
        form_data: Annotated[OAuth2PasswordRequestForm, Depends()],
    ) -> Token:
        user = authenticate_user(fake_users_db, form_data.username, form_data.password)
        if not user:
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Tue Mar 26 16:56:53 GMT 2024
    - 4.1K bytes
    - Viewed (0)
  9. docs/zh/docs/tutorial/response-model.md

    # ๅ“ๅบ”ๆจกๅž‹
    
    ไฝ ๅฏไปฅๅœจไปปๆ„็š„*่ทฏๅพ„ๆ“ไฝœ*ไธญไฝฟ็”จ `response_model` ๅ‚ๆ•ฐๆฅๅฃฐๆ˜Ž็”จไบŽๅ“ๅบ”็š„ๆจกๅž‹๏ผš
    
    * `@app.get()`
    * `@app.post()`
    * `@app.put()`
    * `@app.delete()`
    * ็ญ‰็ญ‰ใ€‚
    
    === "Python 3.10+"
    
        ```Python hl_lines="17  22  24-27"
        {!> ../../../docs_src/response_model/tutorial001_py310.py!}
        ```
    
    === "Python 3.9+"
    
        ```Python hl_lines="17  22  24-27"
        {!> ../../../docs_src/response_model/tutorial001_py39.py!}
        ```
    
    === "Python 3.8+"
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Mar 22 01:42:11 GMT 2024
    - 7.9K bytes
    - Viewed (0)
  10. docs/ja/docs/tutorial/response-model.md

    # ใƒฌใ‚นใƒใƒณใ‚นใƒขใƒ‡ใƒซ
    
    *path operations* ใฎใ„ใšใ‚ŒใซใŠใ„ใฆใ‚‚ใ€`response_model`ใƒ‘ใƒฉใƒกใƒผใ‚ฟใ‚’ไฝฟ็”จใ—ใฆใ€ใƒฌใ‚นใƒใƒณใ‚นใฎใƒขใƒ‡ใƒซใ‚’ๅฎฃ่จ€ใ™ใ‚‹ใ“ใจใŒใงใใพใ™:
    
    * `@app.get()`
    * `@app.post()`
    * `@app.put()`
    * `@app.delete()`
    * ใชใฉใ€‚
    
    ```Python hl_lines="17"
    {!../../../docs_src/response_model/tutorial001.py!}
    ```
    
    !!! note "ๅ‚™่€ƒ"
        `response_model`ใฏใ€Œใƒ‡ใ‚ณใƒฌใƒผใ‚ฟใ€ใƒกใ‚ฝใƒƒใƒ‰๏ผˆ`get`ใ€`post`ใชใฉ๏ผ‰ใฎใƒ‘ใƒฉใƒกใƒผใ‚ฟใงใ‚ใ‚‹ใ“ใจใซๆณจๆ„ใ—ใฆใใ ใ•ใ„ใ€‚ใ™ในใฆใฎใƒ‘ใƒฉใƒกใƒผใ‚ฟใ‚„ใƒœใƒ‡ใ‚ฃใฎใ‚ˆใ†ใซใ€*path operation้–ขๆ•ฐ* ใฎใƒ‘ใƒฉใƒกใƒผใ‚ฟใงใฏใ‚ใ‚Šใพใ›ใ‚“ใ€‚
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Mar 22 01:42:11 GMT 2024
    - 9.3K bytes
    - Viewed (0)
Back to top