- Sort Score
- Result 10 results
- Languages All
Results 41 - 50 of 125 for JSONResponse (0.06 sec)
-
docs_src/additional_status_codes/tutorial001_an.py
from typing import Union from fastapi import Body, FastAPI, status from fastapi.responses import JSONResponse from typing_extensions import Annotated 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[Union[str, None], Body()] = None, size: Annotated[Union[int, None], Body()] = None, ):
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sat Mar 18 12:29:59 UTC 2023 - 734 bytes - Viewed (0) -
src/main/java/org/codelibs/fess/app/web/api/admin/accesstoken/ApiAdminAccesstokenAction.java
import org.codelibs.fess.es.config.exentity.AccessToken; import org.codelibs.fess.helper.PermissionHelper; import org.codelibs.fess.util.ComponentUtil; import org.lastaflute.web.Execute; import org.lastaflute.web.response.JsonResponse; /** * @author shinsuke */ public class ApiAdminAccesstokenAction extends FessApiAdminAction { private static final Logger logger = LogManager.getLogger(ApiAdminAccesstokenAction.class);
Registered: Thu Oct 31 13:40:30 UTC 2024 - Last Modified: Thu Feb 22 01:37:57 UTC 2024 - 7K bytes - Viewed (0) -
src/main/java/org/codelibs/fess/app/web/api/admin/reqheader/ApiAdminReqheaderAction.java
import org.codelibs.fess.app.web.api.admin.FessApiAdminAction; import org.codelibs.fess.es.config.exentity.RequestHeader; import org.lastaflute.web.Execute; import org.lastaflute.web.response.JsonResponse; import jakarta.annotation.Resource; /** * @author Keiichi Watanabe */ public class ApiAdminReqheaderAction extends FessApiAdminAction {
Registered: Thu Oct 31 13:40:30 UTC 2024 - Last Modified: Thu Feb 22 01:53:18 UTC 2024 - 6.8K bytes - Viewed (0) -
src/main/java/org/codelibs/fess/app/web/api/admin/webauth/ApiAdminWebauthAction.java
import org.codelibs.fess.app.web.api.admin.FessApiAdminAction; import org.codelibs.fess.es.config.exentity.WebAuthentication; import org.lastaflute.web.Execute; import org.lastaflute.web.response.JsonResponse; import jakarta.annotation.Resource; /** * @author Keiichi Watanabe */ public class ApiAdminWebauthAction extends FessApiAdminAction {
Registered: Thu Oct 31 13:40:30 UTC 2024 - Last Modified: Thu Feb 22 01:53:18 UTC 2024 - 6.8K bytes - Viewed (0) -
docs_src/response_model/tutorial003_02.py
from fastapi import FastAPI, Response from fastapi.responses import JSONResponse, RedirectResponse app = FastAPI() @app.get("/portal") async def get_portal(teleport: bool = False) -> Response: if teleport: return RedirectResponse(url="https://www.youtube.com/watch?v=dQw4w9WgXcQ")
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Tue Jan 10 16:22:47 UTC 2023 - 381 bytes - Viewed (0) -
src/main/java/org/codelibs/fess/app/web/api/admin/badword/ApiAdminBadwordAction.java
import org.codelibs.fess.exception.FessSystemException; import org.codelibs.fess.helper.SuggestHelper; import org.codelibs.fess.util.ComponentUtil; import org.lastaflute.web.Execute; import org.lastaflute.web.response.JsonResponse; import org.lastaflute.web.response.StreamResponse; import jakarta.annotation.Resource; public class ApiAdminBadwordAction extends FessApiAdminAction {
Registered: Thu Oct 31 13:40:30 UTC 2024 - Last Modified: Thu Feb 22 01:53:18 UTC 2024 - 8.4K bytes - Viewed (0) -
docs/zh/docs/advanced/response-directly.md
然后,**FastAPI** 会在后台将这些兼容 JSON 的数据(比如字典)放到一个 `JSONResponse` 中,该 `JSONResponse` 会用来发送响应给客户端。 但是你可以在你的 *路径操作* 中直接返回一个 `JSONResponse`。 直接返回响应可能会有用处,比如返回自定义的响应头和 cookies。 ## 返回 `Response` 事实上,你可以返回任意 `Response` 或者任意 `Response` 的子类。 /// tip | "小贴士" `JSONResponse` 本身是一个 `Response` 的子类。 /// 当你返回一个 `Response` 时,**FastAPI** 会直接传递它。
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sun Oct 06 20:36:54 UTC 2024 - 3.1K bytes - Viewed (0) -
tests/test_include_route.py
from fastapi import APIRouter, FastAPI, Request from fastapi.responses import JSONResponse from fastapi.testclient import TestClient app = FastAPI() router = APIRouter() @router.route("/items/") def read_items(request: Request): return JSONResponse({"hello": "world"}) app.include_router(router) client = TestClient(app) def test_sub_router(): response = client.get("/items/")
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Wed Apr 08 04:37:38 UTC 2020 - 496 bytes - Viewed (0) -
docs/en/docs/advanced/response-directly.md
But you can return a `JSONResponse` directly from your *path operations*. It might be useful, for example, to return custom headers or cookies. ## Return a `Response` In fact, you can return any `Response` or any sub-class of it. /// tip `JSONResponse` itself is a sub-class of `Response`. ///
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sun Oct 06 20:36:54 UTC 2024 - 3K bytes - Viewed (0) -
docs_src/response_directly/tutorial001.py
from fastapi.responses import JSONResponse from pydantic import BaseModel class Item(BaseModel): title: str timestamp: datetime description: Union[str, None] = None app = FastAPI() @app.put("/items/{id}") def update_item(id: str, item: Item): json_compatible_item_data = jsonable_encoder(item)
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sat May 14 11:59:59 UTC 2022 - 505 bytes - Viewed (0)