- Sort Score
- Num 10 results
- Language All
Results 151 - 160 of 220 for head_item (0.13 seconds)
-
docs_src/dependencies/tutorial002_py310.py
class CommonQueryParams: def __init__(self, q: 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: response.update({"q": commons.q}) items = fake_items_db[commons.skip : commons.skip + commons.limit]Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Fri Jan 07 14:11:31 GMT 2022 - 624 bytes - Click Count (0) -
docs_src/dependencies/tutorial004_py310.py
class CommonQueryParams: def __init__(self, q: 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()): response = {} if commons.q: response.update({"q": commons.q}) items = fake_items_db[commons.skip : commons.skip + commons.limit]Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Fri Jan 07 14:11:31 GMT 2022 - 607 bytes - Click Count (0) -
docs_src/dependencies/tutorial004_an_py310.py
class CommonQueryParams: def __init__(self, q: 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: response.update({"q": commons.q}) items = fake_items_db[commons.skip : commons.skip + commons.limit]Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Sat Mar 18 12:29:59 GMT 2023 - 647 bytes - Click Count (0) -
tests/test_security_oauth2_password_bearer_optional_description.py
app = FastAPI() oauth2_scheme = OAuth2PasswordBearer( tokenUrl="/token", description="OAuth2PasswordBearer security scheme", auto_error=False, ) @app.get("/items/") async def read_items(token: str | None = Security(oauth2_scheme)): if token is None: return {"msg": "Create an account first"} return {"token": token} client = TestClient(app) def test_no_token():
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Tue Feb 17 09:59:14 GMT 2026 - 2.4K bytes - Click Count (0) -
docs_src/dependencies/tutorial012_an_py310.py
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Thu Feb 12 13:19:43 GMT 2026 - 746 bytes - Click Count (0) -
fastapi/security/api_key.py
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Sun Mar 15 11:44:39 GMT 2026 - 9.6K bytes - Click Count (1) -
docs/uk/docs/index.md
Створіть файл `main.py` з: ```Python from fastapi import FastAPI app = FastAPI() @app.get("/") def read_root(): return {"Hello": "World"} @app.get("/items/{item_id}") def read_item(item_id: int, q: str | None = None): return {"item_id": item_id, "q": q} ``` <details markdown="1"> <summary>Або використайте <code>async def</code>...</summary>
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Thu Mar 19 18:27:41 GMT 2026 - 29.1K bytes - Click Count (0) -
docs/de/docs/index.md
```Python from fastapi import FastAPI app = FastAPI() @app.get("/") def read_root(): return {"Hello": "World"} @app.get("/items/{item_id}") def read_item(item_id: int, q: str | None = None): return {"item_id": item_id, "q": q} ``` <details markdown="1"> <summary>Oder verwenden Sie <code>async def</code> ...</summary>
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Thu Mar 19 17:58:09 GMT 2026 - 23.6K bytes - Click Count (1) -
docs_src/app_testing/tutorial004_py310.py
items["bar"] = {"name": "Tenders"} yield # clean up items items.clear() app = FastAPI(lifespan=lifespan) @app.get("/items/{item_id}") async def read_items(item_id: str): return items[item_id] def test_read_items(): # Before the lifespan starts, "items" is still empty assert items == {} with TestClient(app) as client:
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Thu Feb 12 13:19:43 GMT 2026 - 1.2K bytes - Click Count (0) -
tests/test_multi_query_errors.py
from fastapi import FastAPI, Query from fastapi.testclient import TestClient from inline_snapshot import snapshot app = FastAPI() @app.get("/items/") def read_items(q: list[int] = Query(default=None)): return {"q": q} client = TestClient(app) def test_multi_query(): response = client.get("/items/?q=5&q=6") assert response.status_code == 200, response.text assert response.json() == {"q": [5, 6]}
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Sun Feb 08 10:18:38 GMT 2026 - 4.4K bytes - Click Count (0)