- Sort Score
- Result 10 results
- Languages All
Results 361 - 370 of 1,379 for def2 (0.04 sec)
-
tests/test_tutorial/test_behind_a_proxy/test_tutorial001.py
from docs_src.behind_a_proxy.tutorial001 import app client = TestClient(app, root_path="/api/v1") def test_main(): response = client.get("/app") assert response.status_code == 200 assert response.json() == {"message": "Hello World", "root_path": "/api/v1"} def test_openapi(): response = client.get("/openapi.json") assert response.status_code == 200 assert response.json() == {
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Fri Jun 30 18:25:16 UTC 2023 - 1K bytes - Viewed (0) -
docs_src/dependencies/tutorial002.py
fake_items_db = [{"item_name": "Foo"}, {"item_name": "Bar"}, {"item_name": "Baz"}] class CommonQueryParams: def __init__(self, q: Union[str, None] = None, skip: int = 0, limit: int = 100): self.q = q self.skip = skip self.limit = limit @app.get("/items/") async def read_items(commons: CommonQueryParams = Depends(CommonQueryParams)): response = {} if commons.q:
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sat May 14 11:59:59 UTC 2022 - 656 bytes - Viewed (0) -
docs_src/dependencies/tutorial004_an_py39.py
fake_items_db = [{"item_name": "Foo"}, {"item_name": "Bar"}, {"item_name": "Baz"}] class CommonQueryParams: def __init__(self, q: Union[str, None] = None, skip: int = 0, limit: int = 100): self.q = q self.skip = skip self.limit = limit @app.get("/items/") async def read_items(commons: Annotated[CommonQueryParams, Depends()]): response = {} if commons.q:
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sat Mar 18 12:29:59 UTC 2023 - 660 bytes - Viewed (0) -
fastapi/security/http.py
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Thu Sep 19 09:47:28 UTC 2024 - 13.2K bytes - Viewed (0) -
docs_src/events/tutorial001.py
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Thu Mar 26 19:09:53 UTC 2020 - 283 bytes - Viewed (0) -
docs_src/dependencies/tutorial003_an.py
fake_items_db = [{"item_name": "Foo"}, {"item_name": "Bar"}, {"item_name": "Baz"}] class CommonQueryParams: def __init__(self, q: Union[str, None] = None, skip: int = 0, limit: int = 100): self.q = q self.skip = skip self.limit = limit @app.get("/items/") async def read_items(commons: Annotated[Any, Depends(CommonQueryParams)]): response = {} if commons.q:
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sat Mar 18 12:29:59 UTC 2023 - 697 bytes - Viewed (0) -
docs_src/dependencies/tutorial004_an.py
fake_items_db = [{"item_name": "Foo"}, {"item_name": "Bar"}, {"item_name": "Baz"}] class CommonQueryParams: def __init__(self, q: Union[str, None] = None, skip: int = 0, limit: int = 100): self.q = q self.skip = skip self.limit = limit @app.get("/items/") async def read_items(commons: Annotated[CommonQueryParams, Depends()]): response = {} if commons.q:
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sat Mar 18 12:29:59 UTC 2023 - 689 bytes - Viewed (0) -
docs_src/dependencies/tutorial008c_an_py39.py
from fastapi import Depends, FastAPI, HTTPException app = FastAPI() class InternalError(Exception): pass def get_username(): try: yield "Rick" except InternalError: print("Oops, we didn't raise again, Britney 😱") @app.get("/items/{item_id}") def get_item(item_id: str, username: Annotated[str, Depends(get_username)]): if item_id == "portal-gun": raise InternalError(
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sat Feb 24 23:06:37 UTC 2024 - 700 bytes - Viewed (0) -
tests/test_tutorial/test_websockets/test_tutorial001.py
from fastapi.websockets import WebSocketDisconnect from docs_src.websockets.tutorial001 import app client = TestClient(app) def test_main(): response = client.get("/") assert response.status_code == 200, response.text assert b"<!DOCTYPE html>" in response.content def test_websocket(): with pytest.raises(WebSocketDisconnect): with client.websocket_connect("/ws") as websocket:
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Fri Jul 10 09:08:19 UTC 2020 - 822 bytes - Viewed (0) -
tests/test_validate_response_recursive/app_pv2.py
RecursiveItemViaSubmodel.model_rebuild() @app.get("/items/recursive", response_model=RecursiveItem) def get_recursive(): return {"name": "item", "sub_items": [{"name": "subitem", "sub_items": []}]} @app.get("/items/recursive-submodel", response_model=RecursiveItemViaSubmodel) def get_recursive_submodel(): return { "name": "item", "sub_items1": [ {
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Fri Jul 07 17:12:13 UTC 2023 - 1.2K bytes - Viewed (0)