- Sort Score
- Result 10 results
- Languages All
Results 131 - 140 of 694 for statusFn (0.15 sec)
-
tests/test_ws_router.py
await websocket.close(code=status.WS_1006_ABNORMAL_CLOSURE, reason=repr(e)) myapp = make_app(middleware=[Middleware(errorhandler)]) client = TestClient(myapp) with pytest.raises(WebSocketDisconnect) as e: with client.websocket_connect("/depends-err/"): pass # pragma: no cover assert e.value.code == status.WS_1006_ABNORMAL_CLOSURE
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sun Jun 11 19:08:14 UTC 2023 - 7.5K bytes - Viewed (0) -
cmd/admin-handlers-pools.go
writeErrorResponseJSON(ctx, w, apiErr, r.URL) return } status, err := pools.Status(r.Context(), idx) if err != nil { writeErrorResponseJSON(ctx, w, toAdminAPIErr(ctx, err), r.URL) return } adminLogIf(r.Context(), json.NewEncoder(w).Encode(&status)) } func (a adminAPIHandlers) ListPools(w http.ResponseWriter, r *http.Request) { ctx := r.Context()
Registered: Sun Nov 03 19:28:11 UTC 2024 - Last Modified: Fri Jun 28 00:22:30 UTC 2024 - 10.9K bytes - Viewed (0) -
docs/zh/docs/tutorial/path-operation-configuration.md
可以直接传递 `int` 代码, 比如 `404`。 如果记不住数字码的涵义,也可以用 `status` 的快捷常量: ```Python hl_lines="3 17" {!../../docs_src/path_operation_configuration/tutorial001.py!} ``` 状态码在响应中使用,并会被添加到 OpenAPI 概图。 /// note | "技术细节" 也可以使用 `from starlette import status` 导入状态码。 **FastAPI** 的`fastapi.status` 和 `starlette.status` 一样,只是快捷方式。实际上,`fastapi.status` 直接继承自 Starlette。 /// ## `tags` 参数
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sun Oct 06 20:36:54 UTC 2024 - 3.3K bytes - Viewed (0) -
docs_src/handling_errors/tutorial005.py
from fastapi import FastAPI, Request, status from fastapi.encoders import jsonable_encoder from fastapi.exceptions import RequestValidationError from fastapi.responses import JSONResponse from pydantic import BaseModel app = FastAPI() @app.exception_handler(RequestValidationError) async def validation_exception_handler(request: Request, exc: RequestValidationError): return JSONResponse( status_code=status.HTTP_422_UNPROCESSABLE_ENTITY,
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Thu Mar 26 19:09:53 UTC 2020 - 667 bytes - Viewed (0) -
compat/maven-model-builder/src/main/java/org/apache/maven/model/profile/ProfileSelector.java
* injected into the model. * * @param profiles The profiles whose activation status should be determined, must not be {@code null}. * @param context The environmental context used to determine the activation status of a profile, must not be * {@code null}.
Registered: Sun Nov 03 03:35:11 UTC 2024 - Last Modified: Fri Oct 25 12:31:46 UTC 2024 - 3K bytes - Viewed (0) -
docs_src/response_status_code/tutorial002.py
from fastapi import FastAPI, status app = FastAPI() @app.post("/items/", status_code=status.HTTP_201_CREATED) async def create_item(name: str):
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Thu Mar 26 19:09:53 UTC 2020 - 173 bytes - Viewed (0) -
src/test/java/org/codelibs/fess/it/admin/dict/DictTests.java
final List<Map<String, String>> dicts = JsonPath.from(response).getList("response.settings"); final int status = JsonPath.from(response).getInt("response.status"); assertEquals(total, dicts.size()); assertEquals(0, status); } @Override protected void tearDown() { // do nothing } @Test void crudTest() { testRead();
Registered: Thu Oct 31 13:40:30 UTC 2024 - Last Modified: Thu Feb 22 01:37:57 UTC 2024 - 2.7K bytes - Viewed (0) -
internal/logger/target/http/http.go
if resp.StatusCode >= 200 && resp.StatusCode <= 299 { // accepted HTTP status codes. return nil } else if resp.StatusCode == http.StatusForbidden { return fmt.Errorf("%s returned '%s', please check if your auth token is correctly set", h.Endpoint(), resp.Status) } return fmt.Errorf("%s returned '%s', please check your endpoint configuration", h.Endpoint(), resp.Status) }
Registered: Sun Nov 03 19:28:11 UTC 2024 - Last Modified: Wed Sep 11 22:20:42 UTC 2024 - 15.6K bytes - Viewed (0) -
docs_src/additional_status_codes/tutorial001.py
from typing import Union from fastapi import Body, FastAPI, status from fastapi.responses import JSONResponse app = FastAPI() items = {"foo": {"name": "Fighters", "size": 6}, "bar": {"name": "Tenders", "size": 3}} @app.put("/items/{item_id}") async def upsert_item( item_id: str, name: Union[str, None] = Body(default=None), size: Union[int, None] = Body(default=None), ): if item_id in items:
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Fri May 13 23:38:22 UTC 2022 - 684 bytes - Viewed (0) -
docs_src/additional_status_codes/tutorial001_an_py310.py
from typing import Annotated from fastapi import Body, FastAPI, status from fastapi.responses import JSONResponse app = FastAPI() items = {"foo": {"name": "Fighters", "size": 6}, "bar": {"name": "Tenders", "size": 3}} @app.put("/items/{item_id}") async def upsert_item( item_id: str, name: Annotated[str | None, Body()] = None, size: Annotated[int | None, Body()] = None, ): if item_id in items:
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sat Mar 18 12:29:59 UTC 2023 - 686 bytes - Viewed (0)