Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 12 for body (0.18 sec)

  1. 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)
  2. tests/test_tutorial/test_dataclasses/test_tutorial001.py

                        "loc": ["body", "price"],
                        "msg": "Input should be a valid number, unable to parse string as a number",
                        "input": "invalid price",
                    }
                ]
            }
        ) | IsDict(
            # TODO: remove when deprecating Pydantic v1
            {
                "detail": [
                    {
                        "loc": ["body", "price"],
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 5.2K bytes
    - Viewed (0)
  3. tests/test_tutorial/test_body_fields/test_tutorial001.py

                                {"title": "Tax", "type": "number"}
                            ),
                        },
                    },
                    "Body_update_item_items__item_id__put": {
                        "title": "Body_update_item_items__item_id__put",
                        "required": ["item"],
                        "type": "object",
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 7.2K bytes
    - Viewed (0)
  4. tests/test_tutorial/test_request_forms/test_tutorial001.py

        client = TestClient(app)
        return client
    
    
    def test_post_body_form(client: TestClient):
        response = client.post("/login/", data={"username": "Foo", "password": "secret"})
        assert response.status_code == 200
        assert response.json() == {"username": "Foo"}
    
    
    def test_post_body_form_no_password(client: TestClient):
        response = client.post("/login/", data={"username": "Foo"})
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 7.5K bytes
    - Viewed (0)
  5. tests/test_tutorial/test_body/test_tutorial001.py

    import pytest
    from dirty_equals import IsDict
    from fastapi.testclient import TestClient
    
    
    @pytest.fixture
    def client():
        from docs_src.body.tutorial001 import app
    
        client = TestClient(app)
        return client
    
    
    def test_body_float(client: TestClient):
        response = client.post("/items/", json={"name": "Foo", "price": 50.5})
        assert response.status_code == 200
        assert response.json() == {
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 14.7K bytes
    - Viewed (5)
  6. tests/test_tutorial/test_extra_data_types/test_tutorial001.py

                                                {
                                                    "$ref": "#/components/schemas/Body_read_items_items__item_id__put"
                                                }
                                            ],
                                            "title": "Body",
                                        }
                                    )
                                    | IsDict(
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Apr 19 00:11:40 GMT 2024
    - 6.8K 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_tutorial/test_custom_request_and_route/test_tutorial001.py

    
    client = TestClient(app)
    
    
    @pytest.mark.parametrize("compress", [True, False])
    def test_gzip_request(compress):
        n = 1000
        headers = {}
        body = [1] * n
        data = json.dumps(body).encode()
        if compress:
            data = gzip.compress(data)
            headers["Content-Encoding"] = "gzip"
        headers["Content-Type"] = "application/json"
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sun Nov 13 14:26:09 GMT 2022
    - 886 bytes
    - Viewed (0)
  9. tests/test_tutorial/test_body_multiple_params/test_tutorial001.py

    import pytest
    from dirty_equals import IsDict
    from fastapi.testclient import TestClient
    
    
    @pytest.fixture(name="client")
    def get_client():
        from docs_src.body_multiple_params.tutorial001 import app
    
        client = TestClient(app)
        return client
    
    
    def test_post_body_q_bar_content(client: TestClient):
        response = client.put("/items/5?q=bar", json={"name": "Foo", "price": 50.5})
        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.5K bytes
    - Viewed (0)
  10. tests/test_tutorial/test_openapi_callbacks/test_tutorial001.py

                            "invoice_notification": {
                                "{$callback_url}/invoices/{$request.body.id}": {
                                    "post": {
                                        "summary": "Invoice Notification",
                                        "operationId": "invoice_notification__callback_url__invoices___request_body_id__post",
                                        "requestBody": {
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 9K bytes
    - Viewed (0)
Back to top