- Sort Score
- Result 10 results
- Languages All
Results 21 - 30 of 41 for Media (0.15 sec)
-
docs/de/docs/tutorial/request-forms.md
Plain Text - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Sat Mar 30 18:06:54 GMT 2024 - 3.7K bytes - Viewed (0) -
docs_src/response_directly/tutorial002.py
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Thu Mar 26 19:09:53 GMT 2020 - 354 bytes - Viewed (0) -
docs/de/docs/advanced/custom-response.md
* `status_code` – Ein `int`-HTTP-Statuscode. * `headers` – Ein `dict` von Strings. * `media_type` – Ein `str`, der den Medientyp angibt. Z. B. `"text/html"`. FastAPI (eigentlich Starlette) fügt automatisch einen Content-Length-Header ein. Außerdem wird es einen Content-Type-Header einfügen, der auf dem media_type basiert, und für Texttypen einen Zeichensatz (charset) anfügen. ```Python hl_lines="1 18"
Plain Text - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Tue Jan 23 13:05:12 GMT 2024 - 13.5K bytes - Viewed (0) -
tests/test_default_response_class.py
from fastapi.testclient import TestClient class ORJSONResponse(JSONResponse): media_type = "application/x-orjson" def render(self, content: Any) -> bytes: return orjson.dumps(content) class OverrideResponse(JSONResponse): media_type = "application/x-override" app = FastAPI(default_response_class=ORJSONResponse) router_a = APIRouter()
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Sun Mar 01 20:49:20 GMT 2020 - 5.2K bytes - Viewed (0) -
docs/en/mkdocs.yml
site_url: https://fastapi.tiangolo.com/ theme: name: material custom_dir: ../en/overrides palette: - media: '(prefers-color-scheme: light)' scheme: default primary: teal accent: amber toggle: icon: material/lightbulb name: Switch to dark mode - media: '(prefers-color-scheme: dark)' scheme: slate primary: teal accent: amber toggle:
Others - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Thu May 02 22:37:31 GMT 2024 - 9.1K bytes - Viewed (0) -
docs_src/additional_responses/tutorial004.py
response_model=Item, responses={**responses, 200: {"content": {"image/png": {}}}}, ) async def read_item(item_id: str, img: Union[bool, None] = None): if img: return FileResponse("image.png", media_type="image/png") else:
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Sat May 14 11:59:59 GMT 2022 - 701 bytes - Viewed (0) -
docs/ja/docs/advanced/custom-response.md
直接返すことができます。 以下のパラメータを受け付けます。 * `content` - `str` か `bytes`。 * `status_code` - `int` のHTTPステータスコード。 * `headers` - 文字列の `dict` 。 * `media_type` - メディアタイプを示す `str` 。例えば `"text/html"` 。 FastAPI (実際にはStarlette) は自動的にContent-Lengthヘッダーを含みます。また、media_typeに基づいたContent-Typeヘッダーを含み、テキストタイプのためにcharsetを追加します。 ```Python hl_lines="1 18" {!../../../docs_src/response_directly/tutorial002.py!} ```
Plain Text - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Mon Jul 19 19:14:58 GMT 2021 - 10.7K bytes - Viewed (0) -
docs/zh/docs/advanced/custom-response.md
你可以直接返回它。 `Response` 类接受如下参数: * `content` - 一个 `str` 或者 `bytes`。 * `status_code` - 一个 `int` 类型的 HTTP 状态码。 * `headers` - 一个由字符串组成的 `dict`。 * `media_type` - 一个给出媒体类型的 `str`,比如 `"text/html"`。 FastAPI(实际上是 Starlette)将自动包含 Content-Length 的头。它还将包含一个基于 media_type 的 Content-Type 头,并为文本类型附加一个字符集。 ```Python hl_lines="1 18" {!../../../docs_src/response_directly/tutorial002.py!} ``` ### `HTMLResponse`
Plain Text - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Thu May 12 00:06:16 GMT 2022 - 7.8K bytes - Viewed (1) -
tests/test_response_class_no_mediatype.py
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( "/a",
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Fri Jun 30 18:25:16 GMT 2023 - 3.3K bytes - Viewed (0) -
fastapi/dependencies/utils.py
else: BodyFieldInfo = params.Body body_param_media_types = [ f.field_info.media_type for f in flat_dependant.body_params if isinstance(f.field_info, params.Body) ] if len(set(body_param_media_types)) == 1: BodyFieldInfo_kwargs["media_type"] = body_param_media_types[0] final_field = create_response_field( name="body",
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Tue Apr 02 02:52:56 GMT 2024 - 29.5K bytes - Viewed (0)