Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 13 for FormData (0.17 sec)

  1. docs_src/request_form_models/tutorial002_py39.py

    from fastapi import FastAPI, Form
    from pydantic import BaseModel
    
    app = FastAPI()
    
    
    class FormData(BaseModel):
        username: str
        password: str
        model_config = {"extra": "forbid"}
    
    
    @app.post("/login/")
    async def login(data: FormData = Form()):
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 267 bytes
    - Viewed (0)
  2. docs_src/request_form_models/tutorial002_an_py39.py

    from typing import Annotated
    
    from fastapi import FastAPI, Form
    from pydantic import BaseModel
    
    app = FastAPI()
    
    
    class FormData(BaseModel):
        username: str
        password: str
        model_config = {"extra": "forbid"}
    
    
    @app.post("/login/")
    async def login(data: Annotated[FormData, Form()]):
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Fri Sep 06 17:31:18 UTC 2024
    - 307 bytes
    - Viewed (0)
  3. tests/test_tutorial/test_request_form_models/test_tutorial002.py

                                    "schema": {"$ref": "#/components/schemas/FormData"}
                                }
                            },
                            "required": True,
                        },
                    }
                }
            },
            "components": {
                "schemas": {
                    "FormData": {
                        "properties": {
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 20 15:55:38 UTC 2025
    - 6.2K bytes
    - Viewed (0)
  4. docs_src/request_form_models/tutorial001_py39.py

    from fastapi import FastAPI, Form
    from pydantic import BaseModel
    
    app = FastAPI()
    
    
    class FormData(BaseModel):
        username: str
        password: str
    
    
    @app.post("/login/")
    async def login(data: FormData = Form()):
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 228 bytes
    - Viewed (0)
  5. docs_src/request_form_models/tutorial001_an_py39.py

    from typing import Annotated
    
    from fastapi import FastAPI, Form
    from pydantic import BaseModel
    
    app = FastAPI()
    
    
    class FormData(BaseModel):
        username: str
        password: str
    
    
    @app.post("/login/")
    async def login(data: Annotated[FormData, Form()]):
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Thu Sep 05 15:16:50 UTC 2024
    - 268 bytes
    - Viewed (0)
  6. tests/test_tutorial/test_request_form_models/test_tutorial001.py

                                    "schema": {"$ref": "#/components/schemas/FormData"}
                                }
                            },
                            "required": True,
                        },
                    }
                }
            },
            "components": {
                "schemas": {
                    "FormData": {
                        "properties": {
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 18:19:10 UTC 2025
    - 5.7K bytes
    - Viewed (0)
  7. cmd/post-policy_test.go

    		"Content-Encoding": "gzip",
    	}
    
    	// Add form data
    	maps.Copy(formData, addFormData)
    
    	// Create the multipart form.
    	var buf bytes.Buffer
    	w := multipart.NewWriter(&buf)
    
    	// Set the normal formData
    	for k, v := range formData {
    		w.WriteField(k, v)
    	}
    	// Set the File formData but don't if we want send an incomplete multipart request
    	if !corruptedMultipart {
    Registered: Sun Dec 28 19:28:13 UTC 2025
    - Last Modified: Fri Aug 29 02:39:48 UTC 2025
    - 30.6K bytes
    - Viewed (0)
  8. fastapi/datastructures.py

    from pydantic import GetJsonSchemaHandler
    from starlette.datastructures import URL as URL  # noqa: F401
    from starlette.datastructures import Address as Address  # noqa: F401
    from starlette.datastructures import FormData as FormData  # noqa: F401
    from starlette.datastructures import Headers as Headers  # noqa: F401
    from starlette.datastructures import QueryParams as QueryParams  # noqa: F401
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 12:54:56 UTC 2025
    - 5.1K bytes
    - Viewed (0)
  9. fastapi/dependencies/utils.py

        if (
            single_not_embedded_field
            and lenient_issubclass(first_field.type_, BaseModel)
            and isinstance(received_body, FormData)
        ):
            fields_to_extract = get_cached_model_fields(first_field.type_)
    
        if isinstance(received_body, FormData):
            body_to_process = await _extract_form_body(fields_to_extract, received_body)
    
        if single_not_embedded_field:
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 12:54:56 UTC 2025
    - 37.6K bytes
    - Viewed (3)
  10. cmd/utils.go

    	// }
    
    	// Fill the login form with our test creds:
    	// fmt.Printf("login form url: %s\n", lastReq.URL.String())
    	formData := url.Values{}
    	formData.Set("login", username)
    	formData.Set("password", password)
    	req, err = http.NewRequestWithContext(ctx, http.MethodPost, lastReq.URL.String(), strings.NewReader(formData.Encode()))
    	if err != nil {
    		return "", fmt.Errorf("new request err (/login): %v", err)
    	}
    Registered: Sun Dec 28 19:28:13 UTC 2025
    - Last Modified: Sun Sep 28 20:59:21 UTC 2025
    - 33K bytes
    - Viewed (0)
Back to top