- Sort Score
- Result 10 results
- Languages All
Results 481 - 490 of 608 for status_code (1.02 sec)
-
tests/test_security_scopes_dont_propagate.py
): return dep3 client = TestClient(app) def test_security_scopes_dont_propagate(): response = client.get("/scopes") assert response.status_code == 200 assert response.json() == { "dep1": ["scope3", "scope1"], "dep2": ["scope3", "scope2"],Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Wed Dec 17 21:25:59 UTC 2025 - 973 bytes - Viewed (0) -
tests/test_security_scopes_sub_dependency.py
return TestClient(app) def test_security_scopes_sub_dependency_caching( client: TestClient, call_counts: dict[str, int] ): response = client.get("/") assert response.status_code == 200 assert call_counts["get_db_session"] == 1 assert call_counts["get_current_user"] == 2 assert call_counts["get_user_me"] == 2 assert call_counts["get_user_items"] == 1 assert response.json() == {
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Wed Dec 17 21:25:59 UTC 2025 - 2.9K bytes - Viewed (0) -
tests/test_additional_responses_custom_model_in_callback.py
def main_route(callback_url: HttpUrl): pass # pragma: no cover client = TestClient(app) def test_openapi_schema(): response = client.get("/openapi.json") assert response.status_code == 200, response.text assert response.json() == snapshot( { "openapi": "3.1.0", "info": {"title": "FastAPI", "version": "0.1.0"}, "paths": { "/": {
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Sat Dec 27 18:19:10 UTC 2025 - 5.8K bytes - Viewed (0) -
docs/ko/docs/advanced/custom-response.md
--- 또는 `response_class` 매개변수에서 사용할 수도 있습니다: {* ../../docs_src/custom_response/tutorial006b.py hl[2,7,9] *} 이 경우, *경로 작업* 함수에서 URL을 직접 반환할 수 있습니다. 이 경우, 사용되는 `status_code`는 `RedirectResponse`의 기본값인 `307` 입니다. --- `status_code` 매개변수를 `response_class` 매개변수와 함께 사용할 수도 있습니다: {* ../../docs_src/custom_response/tutorial006c.py hl[2,7,9] *} ### `StreamingResponse`Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Sat Feb 15 11:21:20 UTC 2025 - 13.4K bytes - Viewed (0) -
docs/en/docs/advanced/custom-response.md
If you do that, then you can return the URL directly from your *path operation* function. In this case, the `status_code` used will be the default one for the `RedirectResponse`, which is `307`. --- You can also use the `status_code` parameter combined with the `response_class` parameter: {* ../../docs_src/custom_response/tutorial006c_py39.py hl[2,7,9] *}Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Wed Dec 17 20:41:43 UTC 2025 - 12.4K bytes - Viewed (0) -
docs/en/docs/advanced/response-change-status-code.md
## Use a `Response` parameter { #use-a-response-parameter } You can declare a parameter of type `Response` in your *path operation function* (as you can do for cookies and headers). And then you can set the `status_code` in that *temporal* response object. {* ../../docs_src/response_change_status_code/tutorial001_py39.py hl[1,9,12] *} And then you can return any object you need, as you normally would (a `dict`, a database model, etc).Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Wed Dec 17 20:41:43 UTC 2025 - 1.5K bytes - Viewed (0) -
tests/test_param_in_path_and_dependency.py
async def read_users(user_id: int): pass client = TestClient(app) def test_read_users(): response = client.get("/users/42") assert response.status_code == 200, response.text def test_openapi_schema(): response = client.get("/openapi.json") data = response.json() assert data == { "openapi": "3.1.0",
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Fri Jun 30 18:25:16 UTC 2023 - 3.1K bytes - Viewed (0) -
docs/en/docs/advanced/additional-status-codes.md
To achieve that, import `JSONResponse`, and return your content there directly, setting the `status_code` that you want: {* ../../docs_src/additional_status_codes/tutorial001_an_py310.py hl[4,25] *} /// warning When you return a `Response` directly, like in the example above, it will be returned directly.Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Sun Aug 31 09:15:41 UTC 2025 - 2K bytes - Viewed (0) -
docs/pt/docs/advanced/response-change-status-code.md
Você pode declarar um parâmetro do tipo `Response` em sua *função de operação de rota* (assim como você pode fazer para cookies e headers). E então você pode definir o `status_code` neste objeto de retorno temporal. {* ../../docs_src/response_change_status_code/tutorial001_py39.py hl[1,9,12] *}Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Wed Dec 17 20:41:43 UTC 2025 - 1.7K bytes - Viewed (0) -
tests/test_webhooks_security.py
def test_dummy_webhook(): # Just for coverage new_subscription(body={}, token="Bearer 123") def test_openapi_schema(): response = client.get("/openapi.json") assert response.status_code == 200, response.text # insert_assert(response.json()) assert response.json() == { "openapi": "3.1.0", "info": {"title": "FastAPI", "version": "0.1.0"}, "paths": {}, "webhooks": {
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Wed Dec 17 21:25:59 UTC 2025 - 4.5K bytes - Viewed (0)