Search Options

Results per page
Sort
Preferred Languages
Advance

Results 51 - 60 of 411 for posts (0.13 sec)

  1. fastapi/utils.py

            )
        new_field.validators = field.validators  # type: ignore[attr-defined]
        new_field.pre_validators = field.pre_validators  # type: ignore[attr-defined]
        new_field.post_validators = field.post_validators  # type: ignore[attr-defined]
        new_field.parse_json = field.parse_json  # type: ignore[attr-defined]
        new_field.shape = field.shape  # type: ignore[attr-defined]
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 7.8K bytes
    - Viewed (0)
  2. 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)
  3. 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)
  4. 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)
  5. 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)
  6. 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)
  7. 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)
  8. 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)
  9. 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)
  10. 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)
Back to top