- Sort Score
- Result 10 results
- Languages All
Results 61 - 70 of 125 for JSONResponse (0.1 sec)
-
tests/test_response_class_no_mediatype.py
import typing from fastapi import FastAPI, Response from fastapi.responses import JSONResponse from fastapi.testclient import TestClient from pydantic import BaseModel app = FastAPI() class JsonApiResponse(JSONResponse): media_type = "application/vnd.api+json" class Error(BaseModel): status: str title: str class JsonApiError(BaseModel): errors: typing.List[Error] @app.get(
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Fri Jun 30 18:25:16 UTC 2023 - 3.3K bytes - Viewed (0) -
src/main/java/org/codelibs/fess/app/web/api/admin/labeltype/ApiAdminLabeltypeAction.java
import org.codelibs.fess.es.config.exentity.LabelType; import org.codelibs.fess.helper.PermissionHelper; import org.codelibs.fess.util.ComponentUtil; import org.lastaflute.web.Execute; import org.lastaflute.web.response.JsonResponse; import jakarta.annotation.Resource; /** * @author Keiichi Watanabe */ public class ApiAdminLabeltypeAction 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/ko/docs/advanced/response-directly.md
그런 다음, JSON 호환 데이터(예: `dict`)를 `JSONResponse`에 넣어 사용자의 응답을 전송하는 방식으로 처리됩니다. 그러나 *경로 작업*에서 `JSONResponse`를 직접 반환할 수도 있습니다. 예를 들어, 사용자 정의 헤더나 쿠키를 반환해야 하는 경우에 유용할 수 있습니다. ## `Response` 반환하기 사실, `Response` 또는 그 하위 클래스를 반환할 수 있습니다. /// tip `JSONResponse` 자체도 `Response`의 하위 클래스입니다. /// 그리고 `Response`를 반환하면 **FastAPI**가 이를 그대로 전달합니다.
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Wed Oct 30 20:00:57 UTC 2024 - 3.4K bytes - Viewed (0) -
docs/ja/docs/advanced/response-directly.md
このとき背後では、JSON互換なデータ (例えば`dict`) を、クライアントへ送信されるレスポンスとして利用される `JSONResponse` の中に含めます。 しかし、*path operation* から `JSONResponse` を直接返すこともできます。 これは例えば、カスタムヘッダーやcookieを返すときに便利です。 ## `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.6K bytes - Viewed (0) -
tests/test_response_code_no_body.py
import typing from fastapi import FastAPI from fastapi.responses import JSONResponse from fastapi.testclient import TestClient from pydantic import BaseModel app = FastAPI() class JsonApiResponse(JSONResponse): media_type = "application/vnd.api+json" class Error(BaseModel): status: str title: str class JsonApiError(BaseModel): errors: typing.List[Error] @app.get( "/a",
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Fri Jun 30 18:25:16 UTC 2023 - 3.2K bytes - Viewed (0) -
tests/test_additional_responses_response_class.py
import typing from fastapi import FastAPI from fastapi.responses import JSONResponse from fastapi.testclient import TestClient from pydantic import BaseModel app = FastAPI() class JsonApiResponse(JSONResponse): media_type = "application/vnd.api+json" class Error(BaseModel): status: str title: str class JsonApiError(BaseModel): errors: typing.List[Error] @app.get( "/a",
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Fri Jun 30 18:25:16 UTC 2023 - 3.5K bytes - Viewed (0) -
src/main/java/org/codelibs/fess/app/web/api/admin/dict/ApiAdminDictAction.java
import org.lastaflute.web.Execute; import org.lastaflute.web.response.JsonResponse; import jakarta.annotation.Resource; public class ApiAdminDictAction extends FessApiAdminAction { @Resource protected DictionaryManager dictionaryManager; // GET /api/admin/dict @Execute public JsonResponse<ApiResult> get$index() {
Registered: Thu Oct 31 13:40:30 UTC 2024 - Last Modified: Thu Feb 22 01:53:18 UTC 2024 - 2K bytes - Viewed (0) -
docs/en/docs/reference/responses.md
You can import them directly from `fastapi.responses`: ```python from fastapi.responses import ( FileResponse, HTMLResponse, JSONResponse, ORJSONResponse, PlainTextResponse, RedirectResponse, Response, StreamingResponse, UJSONResponse, ) ``` ## FastAPI Responses
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Thu Apr 18 19:53:19 UTC 2024 - 3.7K bytes - Viewed (0) -
src/main/java/org/codelibs/fess/app/web/api/admin/searchlist/ApiAdminSearchlistAction.java
import org.codelibs.fess.exception.ResultOffsetExceededException; import org.codelibs.fess.helper.SearchHelper; import org.codelibs.fess.util.ComponentUtil; import org.lastaflute.web.Execute; import org.lastaflute.web.response.JsonResponse; import org.opensearch.index.query.QueryBuilder; import org.opensearch.index.query.QueryBuilders; import jakarta.annotation.Resource; /** * @author shinsuke */
Registered: Thu Oct 31 13:40:30 UTC 2024 - Last Modified: Wed Jul 24 09:03:45 UTC 2024 - 10.2K bytes - Viewed (0) -
docs_src/additional_responses/tutorial001.py
from fastapi import FastAPI from fastapi.responses import JSONResponse from pydantic import BaseModel class Item(BaseModel): id: str value: str class Message(BaseModel): message: str app = FastAPI() @app.get("/items/{item_id}", response_model=Item, responses={404: {"model": Message}}) async def read_item(item_id: str): if item_id == "foo":
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Fri Aug 26 13:32:30 UTC 2022 - 506 bytes - Viewed (0)