- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 73 for body (0.18 sec)
-
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 21 07:19:11 GMT 2024 - Last Modified: Thu Apr 18 19:40:57 GMT 2024 - 7.6K bytes - Viewed (0) -
tests/test_regex_deprecated_body.py
Python - Registered: Sun Apr 21 07:19:11 GMT 2024 - Last Modified: Thu Apr 18 19:40:57 GMT 2024 - 6.2K bytes - Viewed (0) -
tests/test_tutorial/test_request_forms_and_files/test_tutorial001.py
Python - Registered: Sun Apr 21 07:19:11 GMT 2024 - Last Modified: Thu Apr 18 19:40:57 GMT 2024 - 9.8K bytes - Viewed (0) -
tests/test_tutorial/test_body_multiple_params/test_tutorial003_an_py310.py
Python - Registered: Sun Apr 21 07:19:11 GMT 2024 - Last Modified: Thu Apr 18 19:40:57 GMT 2024 - 9.5K bytes - Viewed (0) -
tests/test_tutorial/test_request_files/test_tutorial002_an.py
Python - Registered: Sun Apr 21 07:19:11 GMT 2024 - Last Modified: Thu Apr 18 19:40:57 GMT 2024 - 8.5K bytes - Viewed (0) -
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 21 07:19:11 GMT 2024 - Last Modified: Fri Apr 19 00:11:40 GMT 2024 - 801 bytes - Viewed (0) -
tests/test_security_oauth2.py
Python - Registered: Sun Apr 21 07:19:11 GMT 2024 - Last Modified: Thu Apr 18 19:40:57 GMT 2024 - 10.7K bytes - Viewed (0) -
tests/test_tutorial/test_custom_request_and_route/test_tutorial002.py
Python - Registered: Sun Apr 21 07:19:11 GMT 2024 - Last Modified: Thu Apr 18 19:40:57 GMT 2024 - 1.2K bytes - Viewed (0) -
tests/test_tutorial/test_request_forms/test_tutorial001_an.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 21 07:19:11 GMT 2024 - Last Modified: Thu Apr 18 19:40:57 GMT 2024 - 7.5K bytes - Viewed (0) -
tests/test_tutorial/test_body_nested_models/test_tutorial009.py
def get_client(): from docs_src.body_nested_models.tutorial009 import app client = TestClient(app) return client def test_post_body(client: TestClient): data = {"2": 2.2, "3": 3.3} response = client.post("/index-weights/", json=data) assert response.status_code == 200, response.text assert response.json() == data def test_post_invalid_body(client: TestClient):
Python - Registered: Sun Apr 21 07:19:11 GMT 2024 - Last Modified: Thu Apr 18 19:40:57 GMT 2024 - 4.2K bytes - Viewed (0)