- Sort Score
- Num 10 results
- Language All
Results 141 - 150 of 1,089 for itens (0.02 seconds)
-
docs/zh-hant/docs/advanced/security/oauth2-scopes.md
現在我們宣告 `/users/me/items/` 這個路徑操作需要 `items` 這個 scope。 為此,我們從 `fastapi` 匯入並使用 `Security`。 你可以使用 `Security` 來宣告相依性(就像 `Depends`),但 `Security` 也能接收參數 `scopes`,其為 scopes(字串)的列表。 在這裡,我們將相依函式 `get_current_active_user` 傳給 `Security`(就像使用 `Depends` 一樣)。 但同時也傳入一個 `list` 的 scopes,這裡只有一個 scope:`items`(當然也可以有更多)。
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Fri Mar 20 17:05:38 GMT 2026 - 12.7K bytes - Click Count (0) -
tests/test_route_scope.py
response = client.post("/usersx/rick") assert response.status_code == 404, response.text def test_websocket(): with client.websocket_connect("/items/portal-gun") as websocket: data = websocket.receive_json() assert data == {"item_id": "portal-gun", "path": "/items/{item_id}"} def test_websocket_invalid_path_doesnt_match(): with pytest.raises(WebSocketDisconnect):
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Mon Sep 29 03:29:38 GMT 2025 - 1.5K bytes - Click Count (0) -
docs_src/path_operation_configuration/tutorial002_py310.py
name: str description: str | None = None price: float tax: float | None = None tags: set[str] = set() @app.post("/items/", tags=["items"]) async def create_item(item: Item) -> Item: return item @app.get("/items/", tags=["items"]) async def read_items(): return [{"name": "Foo", "price": 42}] @app.get("/users/", tags=["users"]) async def read_users():Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Wed Feb 04 12:07:26 GMT 2026 - 524 bytes - Click Count (0) -
tests/test_tutorial/test_body_updates/test_tutorial001.py
def test_get(client: TestClient): response = client.get("/items/baz") assert response.status_code == 200, response.text assert response.json() == { "name": "Baz", "description": None, "price": 50.2, "tax": 10.5, "tags": [], } def test_put(client: TestClient): response = client.put( "/items/bar", json={"name": "Barz", "price": 3, "description": None} )
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Thu Feb 12 13:19:43 GMT 2026 - 7.3K bytes - Click Count (0) -
compat/maven-compat/src/main/java/org/apache/maven/artifact/resolver/DefaultResolutionErrorHandler.java
request.getArtifact(), request.getRemoteRepositories()); } } private static <T> List<T> toList(Collection<T> items) { return (items != null) ? new ArrayList<>(items) : null; }
Created: Sun Apr 05 03:35:12 GMT 2026 - Last Modified: Fri Jun 06 14:28:57 GMT 2025 - 2.7K bytes - Click Count (0) -
docs_src/dependencies/tutorial003_py310.py
self.q = q self.skip = skip self.limit = limit @app.get("/items/") async def read_items(commons=Depends(CommonQueryParams)): response = {} if commons.q: response.update({"q": commons.q}) items = fake_items_db[commons.skip : commons.skip + commons.limit] response.update({"items": items})Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Fri Jan 07 14:11:31 GMT 2022 - 603 bytes - Click Count (0) -
tests/test_tutorial/test_body_multiple_params/test_tutorial003.py
client = TestClient(mod.app) return client def test_post_body_valid(client: TestClient): response = client.put( "/items/5", json={ "importance": 2, "item": {"name": "Foo", "price": 50.5}, "user": {"username": "Dave"}, }, ) assert response.status_code == 200Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Thu Feb 12 13:19:43 GMT 2026 - 8.1K bytes - Click Count (0) -
src/main/webapp/WEB-INF/view/admin/systeminfo/admin_systeminfo.jsp
Created: Tue Mar 31 13:07:34 GMT 2026 - Last Modified: Thu Nov 13 05:54:52 GMT 2025 - 4.7K bytes - Click Count (0) -
tests/test_tutorial/test_body_fields/test_tutorial001.py
def test_items_5(client: TestClient): response = client.put("/items/5", json={"item": {"name": "Foo", "price": 3.0}}) assert response.status_code == 200 assert response.json() == { "item_id": 5, "item": {"name": "Foo", "price": 3.0, "description": None, "tax": None}, } def test_items_6(client: TestClient): response = client.put( "/items/6", json={ "item": {
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Thu Feb 12 13:19:43 GMT 2026 - 6.9K bytes - Click Count (0) -
fastapi/.agents/skills/fastapi/references/streaming.md
To stream JSON Lines, declare the return type and use `yield` to return the data. ```python @app.get("/items/stream") async def stream_items() -> AsyncIterable[Item]: for item in items: yield item ``` ## Server-Sent Events (SSE) To stream Server-Sent Events, use `response_class=EventSourceResponse` and `yield` items from the endpoint.
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Sun Mar 01 10:05:57 GMT 2026 - 2.5K bytes - Click Count (0)