Search Options

Results per page
Sort
Preferred Languages
Advance

Results 21 - 30 of 214 for forms (0.13 sec)

  1. docs/en/mkdocs.yml

        - tutorial/header-params.md
        - tutorial/response-model.md
        - tutorial/extra-models.md
        - tutorial/response-status-code.md
        - tutorial/request-forms.md
        - tutorial/request-files.md
        - tutorial/request-forms-and-files.md
        - tutorial/handling-errors.md
        - tutorial/path-operation-configuration.md
        - tutorial/encoder.md
        - tutorial/body-updates.md
        - Dependencies:
    Others
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu May 02 22:37:31 GMT 2024
    - 9.1K bytes
    - Viewed (0)
  2. docs/en/docs/tutorial/request-files.md

    ## What is "Form Data"
    
    The way HTML forms (`<form></form>`) sends the data to the server normally uses a "special" encoding for that data, it's different from JSON.
    
    **FastAPI** will make sure to read that data from the right place instead of JSON.
    
    !!! note "Technical Details"
        Data from forms is normally encoded using the "media type" `application/x-www-form-urlencoded` when it doesn't include files.
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Wed Mar 13 19:02:19 GMT 2024
    - 10.2K bytes
    - Viewed (0)
  3. tests/test_tutorial/test_request_forms_and_files/test_tutorial001.py

    from fastapi.testclient import TestClient
    
    
    @pytest.fixture(name="app")
    def get_app():
        from docs_src.request_forms_and_files.tutorial001 import app
    
        return app
    
    
    @pytest.fixture(name="client")
    def get_client(app: FastAPI):
        client = TestClient(app)
        return client
    
    
    def test_post_form_no_body(client: TestClient):
        response = client.post("/files/")
        assert response.status_code == 422, response.text
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 9.8K bytes
    - Viewed (0)
  4. tests/test_tutorial/test_request_forms/test_tutorial001_an_py39.py

    from fastapi.testclient import TestClient
    
    from ...utils import needs_py39
    
    
    @pytest.fixture(name="client")
    def get_client():
        from docs_src.request_forms.tutorial001_an_py39 import app
    
        client = TestClient(app)
        return client
    
    
    @needs_py39
    def test_post_body_form(client: TestClient):
        response = client.post("/login/", data={"username": "Foo", "password": "secret"})
        assert response.status_code == 200
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 7.6K bytes
    - Viewed (0)
  5. docs/en/docs/release-notes.md

    * Raise an exception when using form data (`Form`, `File`) without having `python-multipart` installed.
        * Up to now the application would run, and raise an exception only when receiving a request with form data, the new behavior, raising early, will prevent from deploying applications with broken dependencies.
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri May 03 23:25:42 GMT 2024
    - 388.1K bytes
    - Viewed (1)
  6. tests/test_tutorial/test_request_forms_and_files/test_tutorial001_an_py39.py

    from ...utils import needs_py39
    
    
    @pytest.fixture(name="app")
    def get_app():
        from docs_src.request_forms_and_files.tutorial001_an_py39 import app
    
        return app
    
    
    @pytest.fixture(name="client")
    def get_client(app: FastAPI):
        client = TestClient(app)
        return client
    
    
    @needs_py39
    def test_post_form_no_body(client: TestClient):
        response = client.post("/files/")
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 9.9K bytes
    - Viewed (0)
  7. fastapi/security/oauth2.py

    
        @app.post("/login")
        def login(form_data: Annotated[OAuth2PasswordRequestForm, Depends()]):
            data = {}
            data["scopes"] = []
            for scope in form_data.scopes:
                data["scopes"].append(scope)
            if form_data.client_id:
                data["client_id"] = form_data.client_id
            if form_data.client_secret:
                data["client_secret"] = form_data.client_secret
            return data
        ```
    
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Tue Apr 02 02:48:51 GMT 2024
    - 21.1K bytes
    - Viewed (1)
  8. docs_src/request_forms/tutorial001_an.py

    from fastapi import FastAPI, Form
    from typing_extensions import Annotated
    
    app = FastAPI()
    
    
    @app.post("/login/")
    async def login(username: Annotated[str, Form()], password: Annotated[str, Form()]):
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat Mar 18 12:29:59 GMT 2023
    - 233 bytes
    - Viewed (0)
  9. docs/em/docs/tutorial/request-files.md

    ## βš«οΈβ” "πŸ“¨ πŸ’½"
    
    🌌 πŸ•Έ πŸ“¨ (`<form></form>`) πŸ“¨ πŸ’½ πŸ’½ πŸ›Ž βš™οΈ "🎁" πŸ”’ πŸ‘ˆ πŸ“Š, ⚫️ 🎏 βšͺ️➑️ 🎻.
    
    **FastAPI** πŸ”œ βš’ πŸ’­ ✍ πŸ‘ˆ πŸ“Š βšͺ️➑️ ▢️️ πŸ₯‰ ↩️ 🎻.
    
    !!! note "πŸ“‘ β„Ή"
        πŸ“Š βšͺ️➑️ πŸ“¨ πŸ›Ž πŸ—œ βš™οΈ "πŸ“» πŸ†Ž" `application/x-www-form-urlencoded` πŸ•β” ⚫️ 🚫 πŸ”Œ πŸ“.
    
        βœ‹οΈ πŸ•β” πŸ“¨ πŸ”Œ πŸ“, ⚫️ πŸ—œ `multipart/form-data`. πŸš₯ πŸ‘† βš™οΈ `File`, **FastAPI** πŸ”œ πŸ’­ ⚫️ βœ”οΈ 🀚 πŸ“ βšͺ️➑️ β˜‘ πŸ• πŸ’ͺ.
    
    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)
  10. docs/ko/docs/tutorial/request-files.md

    ## "폼 데이터"λž€
    
    HTML의 폼듀(`<form></form>`)이 μ„œλ²„μ— 데이터λ₯Ό μ „μ†‘ν•˜λŠ” 방식은 λŒ€κ°œ 데이터에 JSONκ³ΌλŠ” λ‹€λ₯Έ "νŠΉλ³„ν•œ" 인코딩을 μ‚¬μš©ν•©λ‹ˆλ‹€.
    
    **FastAPI**λŠ” JSON λŒ€μ‹  μ˜¬λ°”λ₯Έ μœ„μΉ˜μ—μ„œ 데이터λ₯Ό 읽을 수 μžˆλ„λ‘ ν•©λ‹ˆλ‹€.
    
    !!! note "기술적 세뢀사항"
        폼의 λ°μ΄ν„°λŠ” 파일이 ν¬ν•¨λ˜μ§€ μ•Šμ€ 경우 일반적으둜 "λ―Έλ””μ–΄ μœ ν˜•" `application/x-www-form-urlencoded` 을 μ‚¬μš©ν•΄ 인코딩 λ©λ‹ˆλ‹€.
    
        ν•˜μ§€λ§Œ 파일이 ν¬ν•¨λœ 경우, `multipart/form-data`둜 μΈμ½”λ”©λ©λ‹ˆλ‹€. `File`을 μ‚¬μš©ν•˜μ˜€λ‹€λ©΄, **FastAPI**λŠ” 본문의 μ ν•©ν•œ λΆ€λΆ„μ—μ„œ νŒŒμΌμ„ 가져와야 ν•œλ‹€λŠ” 것을 μΈμ§€ν•©λ‹ˆλ‹€.
    
    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)
Back to top