- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 21 for _super (0.17 sec)
-
tests/test_tutorial/test_dependencies/test_tutorial012_an.py
response = client.get( "/items/", headers={"X-Token": "fake-super-secret-token", "X-Key": "invalid"} ) assert response.status_code == 400, response.text assert response.json() == {"detail": "X-Key header invalid"} def test_get_invalid_second_header_users(): response = client.get( "/users/", headers={"X-Token": "fake-super-secret-token", "X-Key": "invalid"} )
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Thu Apr 18 19:40:57 GMT 2024 - 8.4K bytes - Viewed (0) -
docs_src/dependencies/tutorial006_an_py39.py
app = FastAPI() async def verify_token(x_token: Annotated[str, Header()]): if x_token != "fake-super-secret-token": raise HTTPException(status_code=400, detail="X-Token header invalid") async def verify_key(x_key: Annotated[str, Header()]): if x_key != "fake-super-secret-key": raise HTTPException(status_code=400, detail="X-Key header invalid") return x_key
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Sat Mar 18 12:29:59 GMT 2023 - 633 bytes - Viewed (0) -
docs_src/bigger_applications/app_an_py39/dependencies.py
from typing import Annotated from fastapi import Header, HTTPException async def get_token_header(x_token: Annotated[str, Header()]): if x_token != "fake-super-secret-token": raise HTTPException(status_code=400, detail="X-Token header invalid") async def get_query_token(token: str): if token != "jessica":
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Sat Mar 18 12:29:59 GMT 2023 - 409 bytes - Viewed (0) -
docs_src/dependencies/tutorial006_an.py
app = FastAPI() async def verify_token(x_token: Annotated[str, Header()]): if x_token != "fake-super-secret-token": raise HTTPException(status_code=400, detail="X-Token header invalid") async def verify_key(x_key: Annotated[str, Header()]): if x_key != "fake-super-secret-key": raise HTTPException(status_code=400, detail="X-Key header invalid") return x_key
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Sat Mar 18 12:29:59 GMT 2023 - 643 bytes - Viewed (0) -
docs_src/custom_request_and_route/tutorial002.py
from fastapi.exceptions import RequestValidationError from fastapi.routing import APIRoute class ValidationErrorLoggingRoute(APIRoute): def get_route_handler(self) -> Callable: original_route_handler = super().get_route_handler() async def custom_route_handler(request: Request) -> Response: try: return await original_route_handler(request) except RequestValidationError as exc:
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Fri May 13 23:38:22 GMT 2022 - 932 bytes - Viewed (0) -
docs_src/dependencies/tutorial006.py
app = FastAPI() async def verify_token(x_token: str = Header()): if x_token != "fake-super-secret-token": raise HTTPException(status_code=400, detail="X-Token header invalid") async def verify_key(x_key: str = Header()): if x_key != "fake-super-secret-key": raise HTTPException(status_code=400, detail="X-Key header invalid") return x_key
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Fri May 13 23:38:22 GMT 2022 - 583 bytes - Viewed (0) -
tests/test_dependency_cache.py
return counter_holder["counter"] async def super_dep(count: int = Depends(dep_counter)): return count @app.get("/counter/") async def get_counter(count: int = Depends(dep_counter)): return {"counter": count} @app.get("/sub-counter/") async def get_sub_counter( subcount: int = Depends(super_dep), count: int = Depends(dep_counter) ):
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Tue Aug 23 13:30:24 GMT 2022 - 2.7K bytes - Viewed (0) -
docs_src/bigger_applications/app_an/dependencies.py
from fastapi import Header, HTTPException from typing_extensions import Annotated async def get_token_header(x_token: Annotated[str, Header()]): if x_token != "fake-super-secret-token": raise HTTPException(status_code=400, detail="X-Token header invalid") async def get_query_token(token: str): if token != "jessica":
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Sat Mar 18 12:29:59 GMT 2023 - 419 bytes - Viewed (0) -
tests/test_tutorial/test_dependencies/test_tutorial012_an_py39.py
"/items/", headers={"X-Token": "fake-super-secret-token", "X-Key": "invalid"} ) assert response.status_code == 400, response.text assert response.json() == {"detail": "X-Key header invalid"} @needs_py39 def test_get_invalid_second_header_users(client: TestClient): response = client.get( "/users/", headers={"X-Token": "fake-super-secret-token", "X-Key": "invalid"} )
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Thu Apr 18 19:40:57 GMT 2024 - 8.8K bytes - Viewed (0) -
docs_src/dependencies/tutorial012_an_py39.py
from typing_extensions import Annotated async def verify_token(x_token: Annotated[str, Header()]): if x_token != "fake-super-secret-token": raise HTTPException(status_code=400, detail="X-Token header invalid") async def verify_key(x_key: Annotated[str, Header()]): if x_key != "fake-super-secret-key": raise HTTPException(status_code=400, detail="X-Key header invalid") return x_key
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Sat Mar 18 12:29:59 GMT 2023 - 756 bytes - Viewed (0)