- Sort Score
- Num 10 results
- Language All
Results 601 - 610 of 1,083 for str (0.01 seconds)
-
docs/zh/docs/advanced/security/oauth2-scopes.md
然后使用 Pydantic 模型验证这些数据(捕获 `ValidationError` 异常),如果读取 JWT 令牌或用 Pydantic 验证数据时出错,就抛出我们之前创建的 `HTTPException`。 为此,我们给 Pydantic 模型 `TokenData` 添加了一个新属性 `scopes`。 通过用 Pydantic 验证数据,我们可以确保确实得到了例如一个由作用域组成的 `list[str]`,以及一个 `str` 类型的 `username`。 而不是,例如得到一个 `dict` 或其它什么,这可能会在后续某个时刻破坏应用,形成安全风险。 我们还验证是否存在该用户名的用户,如果没有,就抛出前面创建的同一个异常。 {* ../../docs_src/security/tutorial005_an_py310.py hl[47,117:129] *}Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Fri Mar 20 17:06:37 GMT 2026 - 13K bytes - Click Count (0) -
src/test/java/org/codelibs/fess/opensearch/config/exentity/JobLogTest.java
final ScheduledJob scheduledJob = createTestScheduledJob(); final JobLog jobLog = new JobLog(scheduledJob); final String str = jobLog.toString(); assertTrue(str.contains("Test Job")); assertTrue(str.contains(Constants.RUNNING)); } private ScheduledJob createTestScheduledJob() { final ScheduledJob scheduledJob = new ScheduledJob();
Created: Tue Mar 31 13:07:34 GMT 2026 - Last Modified: Sat Mar 28 11:55:54 GMT 2026 - 3.7K bytes - Click Count (0) -
src/test/java/jcifs/tests/persistent/HandleInfoTest.java
HandleInfo info = new HandleInfo("/test/file.txt", testGuid, testFileId, HandleType.PERSISTENT, 0, testLeaseKey); String str = info.toString(); assertTrue(str.contains("/test/file.txt")); assertTrue(str.contains("PERSISTENT")); assertTrue(str.contains(testGuid.toString())); }
Created: Sun Apr 05 00:10:12 GMT 2026 - Last Modified: Thu Aug 21 04:51:33 GMT 2025 - 4.6K bytes - Click Count (0) -
docs/en/docs/tutorial/query-params.md
{* ../../docs_src/query_params/tutorial005_py310.py hl[6:7] *} Here the query parameter `needy` is a required query parameter of type `str`. If you open in your browser a URL like: ``` http://127.0.0.1:8000/items/foo-item ``` ...without adding the required parameter `needy`, you will see an error like: ```JSON {Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Thu Mar 05 18:13:19 GMT 2026 - 4.5K bytes - Click Count (0) -
docs/zh/docs/tutorial/body-updates.md
## 用 `PUT` 替换式更新 { #update-replacing-with-put } 更新数据可以使用 [HTTP `PUT`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/PUT) 操作。 把输入数据转换为以 JSON 格式存储的数据(比如,使用 NoSQL 数据库时),可以使用 `jsonable_encoder`。例如,把 `datetime` 转换为 `str`。 {* ../../docs_src/body_updates/tutorial001_py310.py hl[28:33] *} `PUT` 用于接收替换现有数据的数据。 ### 关于替换的警告 { #warning-about-replacing } 用 `PUT` 把数据项 `bar` 更新为以下请求体时: ```Python { "name": "Barz",Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Fri Mar 20 17:06:37 GMT 2026 - 3.7K bytes - Click Count (0) -
migrator/migrator.go
for _, opt := range opts { str := stmt.Quote(opt.DBName) if opt.Expression != "" { str = opt.Expression } else if opt.Length > 0 { str += fmt.Sprintf("(%d)", opt.Length) } if opt.Collate != "" { str += " COLLATE " + opt.Collate } if opt.Sort != "" { str += " " + opt.Sort } results = append(results, clause.Expr{SQL: str}) } return }Created: Sun Apr 05 09:35:12 GMT 2026 - Last Modified: Sat Mar 21 11:49:01 GMT 2026 - 29.8K bytes - Click Count (0) -
docs/zh-hant/docs/tutorial/body-updates.md
## 使用 `PUT` 取代式更新 { #update-replacing-with-put } 要更新一個項目,你可以使用 [HTTP `PUT`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/PUT) 操作。 你可以使用 `jsonable_encoder` 將輸入資料轉換為可儲存為 JSON 的資料(例如用於 NoSQL 資料庫)。例如把 `datetime` 轉成 `str`。 {* ../../docs_src/body_updates/tutorial001_py310.py hl[28:33] *} `PUT` 用於接收應該取代現有資料的資料。 ### 關於取代的警告 { #warning-about-replacing } 這表示,如果你想用 `PUT` 並在 body 中包含以下內容來更新項目 `bar`: ```Python {Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Fri Mar 20 17:05:38 GMT 2026 - 3.7K bytes - Click Count (0) -
tests/test_security_oauth2_authorization_code_bearer_description.py
oauth2_scheme = OAuth2AuthorizationCodeBearer( authorizationUrl="authorize", tokenUrl="token", description="OAuth2 Code Bearer", auto_error=True, ) @app.get("/items/") async def read_items(token: str | None = Security(oauth2_scheme)): return {"token": token} client = TestClient(app) def test_no_token(): response = client.get("/items") assert response.status_code == 401, response.text
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Tue Feb 17 09:59:14 GMT 2026 - 2.5K bytes - Click Count (0) -
tests/test_security_oauth2_password_bearer_optional.py
from fastapi.testclient import TestClient from inline_snapshot import snapshot app = FastAPI() oauth2_scheme = OAuth2PasswordBearer(tokenUrl="/token", 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.2K bytes - Click Count (0) -
src/test/java/jcifs/internal/smb1/trans2/Trans2SetFileInformationResponseTest.java
@DisplayName("Test toString contains proper class name") void testToStringFormat() { String str = response.toString(); // Should start with the class name assertTrue(str.startsWith("Trans2SetFileInformationResponse[")); // Should end with closing bracket assertTrue(str.endsWith("]")); // Should contain parent toString contentCreated: Sun Apr 05 00:10:12 GMT 2026 - Last Modified: Thu Aug 14 05:31:44 GMT 2025 - 15.9K bytes - Click Count (0)