Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 28 for body (0.24 sec)

  1. tests/test_tutorial/test_request_forms_and_files/test_tutorial001_an_py39.py

        return client
    
    
    @needs_py39
    def test_post_form_no_body(client: TestClient):
        response = client.post("/files/")
        assert response.status_code == 422, response.text
        assert response.json() == IsDict(
            {
                "detail": [
                    {
                        "type": "missing",
                        "loc": ["body", "file"],
                        "msg": "Field required",
    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)
  2. fastapi/dependencies/utils.py

        if dependant.body_params:
            (
                body_values,
                body_errors,
            ) = await request_body_to_args(  # body_params checked above
                required_params=dependant.body_params, received_body=body
            )
            values.update(body_values)
            errors.extend(body_errors)
        if dependant.http_connection_param_name:
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Tue Apr 02 02:52:56 GMT 2024
    - 29.5K bytes
    - Viewed (0)
  3. fastapi/openapi/utils.py

        body_schema = get_schema_from_model_field(
            field=body_field,
            schema_generator=schema_generator,
            model_name_map=model_name_map,
            field_mapping=field_mapping,
            separate_input_output_schemas=separate_input_output_schemas,
        )
        field_info = cast(Body, body_field.field_info)
        request_media_type = field_info.media_type
        required = body_field.required
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 21.8K bytes
    - Viewed (0)
  4. tests/test_openapi_examples.py

    from dirty_equals import IsDict
    from fastapi import Body, Cookie, FastAPI, Header, Path, Query
    from fastapi.testclient import TestClient
    from pydantic import BaseModel
    
    app = FastAPI()
    
    
    class Item(BaseModel):
        data: str
    
    
    @app.post("/examples/")
    def examples(
        item: Item = Body(
            examples=[
                {"data": "Data in Body examples, example1"},
            ],
            openapi_examples={
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Tue Oct 24 20:26:06 GMT 2023
    - 17K bytes
    - Viewed (0)
  5. tests/test_tutorial/test_security/test_tutorial005_an_py39.py

                            "token_type": {"title": "Token Type", "type": "string"},
                        },
                    },
                    "Body_login_for_access_token_token_post": {
                        "title": "Body_login_for_access_token_token_post",
                        "required": ["username", "password"],
                        "type": "object",
                        "properties": {
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Wed Mar 13 19:07:10 GMT 2024
    - 16.3K bytes
    - Viewed (0)
  6. tests/test_tutorial/test_security/test_tutorial005_py310.py

                            "token_type": {"title": "Token Type", "type": "string"},
                        },
                    },
                    "Body_login_for_access_token_token_post": {
                        "title": "Body_login_for_access_token_token_post",
                        "required": ["username", "password"],
                        "type": "object",
                        "properties": {
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Wed Mar 13 19:07:10 GMT 2024
    - 16.3K bytes
    - Viewed (0)
  7. tests/test_tutorial/test_request_forms_and_files/test_tutorial001.py

        client = TestClient(app)
        return client
    
    
    def test_post_form_no_body(client: TestClient):
        response = client.post("/files/")
        assert response.status_code == 422, response.text
        assert response.json() == IsDict(
            {
                "detail": [
                    {
                        "type": "missing",
                        "loc": ["body", "file"],
                        "msg": "Field required",
    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)
  8. tests/test_security_oauth2.py

                "detail": [
                    {
                        "type": "missing",
                        "loc": ["body", "grant_type"],
                        "msg": "Field required",
                        "input": None,
                    },
                    {
                        "type": "missing",
                        "loc": ["body", "username"],
                        "msg": "Field required",
                        "input": None,
                    },
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 10.7K bytes
    - Viewed (0)
  9. tests/test_security_oauth2_optional_description.py

                "detail": [
                    {
                        "type": "missing",
                        "loc": ["body", "grant_type"],
                        "msg": "Field required",
                        "input": None,
                    },
                    {
                        "type": "missing",
                        "loc": ["body", "username"],
                        "msg": "Field required",
                        "input": None,
                    },
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 10.9K bytes
    - Viewed (0)
  10. tests/test_sub_callbacks.py

    @invoices_callback_router.post(
        "{$callback_url}/invoices/{$request.body.id}", response_model=InvoiceEventReceived
    )
    def invoice_notification(body: InvoiceEvent):
        pass  # pragma: nocover
    
    
    class Event(BaseModel):
        name: str
        total: float
    
    
    events_callback_router = APIRouter()
    
    
    @events_callback_router.get("{$callback_url}/events/{$request.body.title}")
    def event_callback(event: Event):
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 13.8K bytes
    - Viewed (0)
Back to top