Search Options

Results per page
Sort
Preferred Languages
Advance

Results 41 - 50 of 1,063 for body (0.15 sec)

  1. docs/pt/docs/tutorial/body-multiple-params.md

    ```Python
    item: Item = Body(embed=True)
    ```
    
    como em:
    
    === "Python 3.10+"
    
        ```Python hl_lines="15"
        {!> ../../../docs_src/body_multiple_params/tutorial005_py310.py!}
        ```
    
    === "Python 3.8+"
    
        ```Python hl_lines="17"
        {!> ../../../docs_src/body_multiple_params/tutorial005.py!}
        ```
    
    Plain Text
    - Registered: Sun Apr 14 07:19:09 GMT 2024
    - Last Modified: Tue Oct 17 05:59:11 GMT 2023
    - 6K bytes
    - Viewed (0)
  2. docs/pt/docs/tutorial/body-nested-models.md

    ### Defina um sub-modelo
    
    Por exemplo, nós podemos definir um modelo `Image`:
    
    ```Python hl_lines="9-11"
    {!../../../docs_src/body_nested_models/tutorial004.py!}
    ```
    
    ### Use o sub-modelo como um tipo
    
    E então podemos usa-lo como o tipo de um atributo:
    
    ```Python hl_lines="20"
    {!../../../docs_src/body_nested_models/tutorial004.py!}
    ```
    
    Isso significa que o **FastAPI** vai esperar um corpo similar à:
    
    ```JSON
    {
    Plain Text
    - Registered: Sun Apr 14 07:19:09 GMT 2024
    - Last Modified: Fri Mar 22 01:42:11 GMT 2024
    - 7.4K bytes
    - Viewed (0)
  3. tests/test_multi_body_errors.py

    app = FastAPI()
    
    
    class Item(BaseModel):
        name: str
        age: condecimal(gt=Decimal(0.0))  # type: ignore
    
    
    @app.post("/items/")
    def save_item_no_body(item: List[Item]):
        return {"item": item}
    
    
    client = TestClient(app)
    
    
    def test_put_correct_body():
        response = client.post("/items/", json=[{"name": "Foo", "age": 5}])
        assert response.status_code == 200, response.text
        assert response.json() == {
    Python
    - Registered: Sun Apr 14 07:19:09 GMT 2024
    - Last Modified: Sat Aug 19 18:47:59 GMT 2023
    - 8K bytes
    - Viewed (0)
  4. tests/test_regex_deprecated_body.py

                                                {
                                                    "$ref": "#/components/schemas/Body_read_items_items__post"
                                                }
                                            ],
                                            "title": "Body",
                                        }
                                    )
                                    | IsDict(
    Python
    - Registered: Sun Apr 14 07:19:09 GMT 2024
    - Last Modified: Tue Mar 26 16:56:53 GMT 2024
    - 6.3K bytes
    - Viewed (0)
  5. tests/test_put_no_body.py

    app = FastAPI()
    
    
    @app.put("/items/{item_id}")
    def save_item_no_body(item_id: str):
        return {"item_id": item_id}
    
    
    client = TestClient(app)
    
    
    def test_put_no_body():
        response = client.put("/items/foo")
        assert response.status_code == 200, response.text
        assert response.json() == {"item_id": "foo"}
    
    
    def test_put_no_body_with_body():
        response = client.put("/items/foo", json={"name": "Foo"})
    Python
    - Registered: Sun Apr 14 07:19:09 GMT 2024
    - Last Modified: Fri Jun 30 18:25:16 GMT 2023
    - 3.3K bytes
    - Viewed (0)
  6. tests/test_union_inherited_body.py

                                    }
                                },
                            },
                        },
                        "summary": "Save Union Different Body",
                        "operationId": "save_union_different_body_items__post",
                        "requestBody": {
                            "content": {
                                "application/json": {
                                    "schema": {
    Python
    - Registered: Sun Apr 14 07:19:09 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 5.2K bytes
    - Viewed (0)
  7. tests/test_get_request_body.py

    @app.get("/product")
    async def create_item(product: Product):
        return product
    
    
    client = TestClient(app)
    
    
    def test_get_with_body():
        body = {"name": "Foo", "description": "Some description", "price": 5.5}
        response = client.request("GET", "/product", json=body)
        assert response.json() == body
    
    
    def test_openapi_schema():
        response = client.get("/openapi.json")
        assert response.status_code == 200, response.text
    Python
    - Registered: Sun Apr 14 07:19:09 GMT 2024
    - Last Modified: Fri Jun 30 18:25:16 GMT 2023
    - 3.7K bytes
    - Viewed (0)
  8. tests/test_request_body_parameters_media_type.py

    async def create_product(data: Product = Body(media_type=media_type, embed=True)):
        pass  # pragma: no cover
    
    
    @app.post("/shops")
    async def create_shop(
        data: Shop = Body(media_type=media_type),
        included: typing.List[Product] = Body(default=[], media_type=media_type),
    ):
        pass  # pragma: no cover
    
    
    client = TestClient(app)
    
    
    def test_openapi_schema():
        response = client.get("/openapi.json")
    Python
    - Registered: Sun Apr 14 07:19:09 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 6.4K bytes
    - Viewed (0)
  9. tests/test_response_code_no_body.py

    Sebastián Ramírez <******@****.***> 1688149516 +0200
    Python
    - Registered: Sun Apr 14 07:19:09 GMT 2024
    - Last Modified: Fri Jun 30 18:25:16 GMT 2023
    - 3.2K bytes
    - Viewed (0)
  10. okhttp/src/test/java/okhttp3/CallTest.kt

        server.enqueue(MockResponse(body = "abc"))
        server.enqueue(MockResponse(body = "def"))
    
        // Call 1: set a deadline on the response body.
        val request1 = Request.Builder().url(server.url("/")).build()
        val response1 = client.newCall(request1).execute()
        val body1 = response1.body.source()
        assertThat(body1.readUtf8()).isEqualTo("abc")
        body1.timeout().deadline(5, TimeUnit.SECONDS)
    
    Plain Text
    - Registered: Fri Apr 12 11:42:09 GMT 2024
    - Last Modified: Wed Apr 10 19:46:48 GMT 2024
    - 142.5K bytes
    - Viewed (0)
Back to top