Search Options

Results per page
Sort
Preferred Languages
Advance

Results 41 - 50 of 203 for body (0.17 sec)

  1. tests/test_tutorial/test_body_multiple_params/test_tutorial003_an_py39.py

                        "loc": ["body", "item"],
                        "msg": "field required",
                        "type": "value_error.missing",
                    },
                    {
                        "loc": ["body", "user"],
                        "msg": "field required",
                        "type": "value_error.missing",
                    },
                    {
                        "loc": ["body", "importance"],
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 9.5K bytes
    - Viewed (0)
  2. tests/test_tutorial/test_request_files/test_tutorial002_an.py

    client = TestClient(app)
    
    
    def test_post_form_no_body():
        response = client.post("/files/")
        assert response.status_code == 422, response.text
        assert response.json() == IsDict(
            {
                "detail": [
                    {
                        "type": "missing",
                        "loc": ["body", "files"],
                        "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
    - 8.5K bytes
    - Viewed (0)
  3. tests/test_tutorial/test_request_files/test_tutorial001_02_an_py39.py

        client = TestClient(app)
        return client
    
    
    @needs_py39
    def test_post_form_no_body(client: TestClient):
        response = client.post("/files/")
        assert response.status_code == 200, response.text
        assert response.json() == {"message": "No file sent"}
    
    
    @needs_py39
    def test_post_uploadfile_no_body(client: TestClient):
        response = client.post("/uploadfile/")
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 8.5K bytes
    - Viewed (0)
  4. docs_src/extra_data_types/tutorial001_an_py39.py

    from uuid import UUID
    
    from fastapi import Body, FastAPI
    
    app = FastAPI()
    
    
    @app.put("/items/{item_id}")
    async def read_items(
        item_id: UUID,
        start_datetime: Annotated[datetime, Body()],
        end_datetime: Annotated[datetime, Body()],
        process_after: Annotated[timedelta, Body()],
        repeat_at: Annotated[Union[time, None], Body()] = None,
    ):
        start_process = start_datetime + process_after
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Apr 19 00:11:40 GMT 2024
    - 801 bytes
    - Viewed (0)
  5. 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)
  6. tests/test_tutorial/test_custom_request_and_route/test_tutorial002.py

                        }
                    ],
                    "body": '{"numbers": [1, 2, 3]}',
                }
            }
        ) | IsDict(
            # TODO: remove when deprecating Pydantic v1
            {
                "detail": {
                    "body": '{"numbers": [1, 2, 3]}',
                    "errors": [
                        {
                            "loc": ["body"],
                            "msg": "value is not a valid list",
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 1.2K bytes
    - Viewed (0)
  7. tests/test_tutorial/test_request_files/test_tutorial001.py

                        "required": ["file"],
                        "type": "object",
                        "properties": {
                            "file": {"title": "File", "type": "string", "format": "binary"}
                        },
                    },
                    "Body_create_file_files__post": {
                        "title": "Body_create_file_files__post",
                        "required": ["file"],
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 7.7K bytes
    - Viewed (0)
  8. docs_src/extra_data_types/tutorial001_py310.py

    from datetime import datetime, time, timedelta
    from uuid import UUID
    
    from fastapi import Body, FastAPI
    
    app = FastAPI()
    
    
    @app.put("/items/{item_id}")
    async def read_items(
        item_id: UUID,
        start_datetime: datetime = Body(),
        end_datetime: datetime = Body(),
        process_after: timedelta = Body(),
        repeat_at: time | None = Body(default=None),
    ):
        start_process = start_datetime + process_after
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Apr 19 00:11:40 GMT 2024
    - 724 bytes
    - Viewed (0)
  9. docs_src/path_operation_advanced_configuration/tutorial006.py

                        }
                    }
                },
                "required": True,
            },
        },
    )
    async def create_item(request: Request):
        raw_body = await request.body()
        data = magic_data_reader(raw_body)
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Jul 29 20:01:13 GMT 2021
    - 1K bytes
    - Viewed (0)
  10. 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)
Back to top