- Sort Score
- Result 10 results
- Languages All
Results 51 - 60 of 744 for POST (0.04 sec)
-
tests/test_tutorial/test_request_forms/test_tutorial001_an_py39.py
@needs_py39 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"} @needs_py39 def test_post_body_form_no_password(client: TestClient): response = client.post("/login/", data={"username": "Foo"}) assert response.status_code == 422
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Thu Apr 18 19:40:57 UTC 2024 - 7.6K bytes - Viewed (0) -
tests/test_tutorial/test_request_files/test_tutorial002.py
from dirty_equals import IsDict from fastapi.testclient import TestClient from docs_src.request_files.tutorial002 import app 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",
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Thu Apr 18 19:40:57 UTC 2024 - 8.5K bytes - Viewed (0) -
tests/test_additional_properties_bool.py
pass app = FastAPI() @app.post("/") async def post( foo: Union[Foo, None] = None, ): return foo client = TestClient(app) def test_call_invalid(): response = client.post("/", json={"foo": {"bar": "baz"}}) assert response.status_code == 422 def test_call_valid(): response = client.post("/", json={}) assert response.status_code == 200
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Fri Jul 07 17:12:13 UTC 2023 - 4.2K bytes - Viewed (0) -
src/main/java/org/codelibs/fess/app/web/api/admin/dict/kuromoji/ApiAdminDictKuromojiAction.java
return asJson( new ApiResult.ApiUpdateResponse().id(String.valueOf(entity.getId())).created(true).status(ApiResult.Status.OK).result()); } // POST /api/admin/dict/kuromoji/setting/{dictId} @Execute public JsonResponse<ApiResult> post$setting(final String dictId, final EditBody body) { body.dictId = dictId; validateApi(body, messages -> {}); body.crudMode = CrudMode.EDIT;
Registered: Thu Oct 31 13:40:30 UTC 2024 - Last Modified: Thu Feb 22 01:53:18 UTC 2024 - 7.3K bytes - Viewed (0) -
tests/test_sub_callbacks.py
class InvoiceEvent(BaseModel): description: str paid: bool class InvoiceEventReceived(BaseModel): ok: bool invoices_callback_router = APIRouter() @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
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Fri Jul 07 17:12:13 UTC 2023 - 13.8K bytes - Viewed (0) -
tests/test_union_inherited_body.py
class Item(BaseModel): name: Optional[str] = None class ExtendedItem(Item): age: int @app.post("/items/") def save_union_different_body(item: Union[ExtendedItem, Item]): return {"item": item} client = TestClient(app) def test_post_extended_item(): response = client.post("/items/", json={"name": "Foo", "age": 5}) assert response.status_code == 200, response.text
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Fri Jul 07 17:12:13 UTC 2023 - 5.2K bytes - Viewed (0) -
tests/test_tutorial/test_request_files/test_tutorial001_03.py
response = client.post("/files/", files={"file": file}) assert response.status_code == 200, response.text assert response.json() == {"file_size": 14} def test_post_upload_file(tmp_path): path = tmp_path / "test.txt" path.write_bytes(b"<file content>") client = TestClient(app) with path.open("rb") as file: response = client.post("/uploadfile/", files={"file": file})
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Fri Jun 30 18:25:16 UTC 2023 - 6K bytes - Viewed (0) -
tests/test_tutorial/test_path_operation_advanced_configurations/test_tutorial007.py
@needs_pydanticv2 def test_post(client: TestClient): yaml_data = """ name: Deadpoolio tags: - x-force - x-men - x-avengers """ response = client.post("/items/", content=yaml_data) assert response.status_code == 200, response.text assert response.json() == { "name": "Deadpoolio", "tags": ["x-force", "x-men", "x-avengers"], }
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Thu Apr 18 19:40:57 UTC 2024 - 3.3K bytes - Viewed (0) -
tests/test_modules_same_name_body/test_main.py
client = TestClient(app) def test_post_a(): data = {"a": 2, "b": "foo"} response = client.post("/a/compute", json=data) assert response.status_code == 200, response.text data = response.json() def test_post_a_invalid(): data = {"a": "bar", "b": "foo"} response = client.post("/a/compute", json=data) assert response.status_code == 422, response.text def test_post_b():
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Fri Jun 30 18:25:16 UTC 2023 - 5.6K bytes - Viewed (0) -
src/main/java/org/codelibs/fess/app/web/api/admin/scheduler/ApiAdminSchedulerAction.java
@Execute public HtmlResponse index() { throw new UnsupportedOperationException(); } // POST /api/admin/scheduler/{id}/start @Execute(urlPattern = "{}/@word") public JsonResponse<ApiResult> post$start(final String id) { scheduledJobService.getScheduledJob(id).ifPresent(entity -> { if (!entity.isEnabled() || entity.isRunning()) {
Registered: Thu Oct 31 13:40:30 UTC 2024 - Last Modified: Thu Feb 22 01:53:18 UTC 2024 - 7.6K bytes - Viewed (0)