- Sort Score
- Num 10 results
- Language All
Results 1 - 10 of 24 for mediaType (0.04 seconds)
-
fastapi/openapi/models.py
Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Sat Dec 27 12:54:56 GMT 2025 - 15.1K bytes - Click Count (0) -
tests/test_request_body_parameters_media_type.py
@app.post("/shops") async def create_shop( data: Shop = Body(media_type=media_type), included: list[Product] = Body(default=[], media_type=media_type), ): pass # pragma: no cover client = TestClient(app) def test_openapi_schema(): response = client.get("/openapi.json") assert response.status_code == 200, response.text assert response.json() == { "openapi": "3.1.0",
Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Wed Dec 17 21:25:59 GMT 2025 - 6.3K bytes - Click Count (0) -
docs_src/response_directly/tutorial002_py39.py
Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Wed Dec 17 20:41:43 GMT 2025 - 354 bytes - Click Count (0) -
docs_src/custom_response/tutorial009c_py39.py
from typing import Any import orjson from fastapi import FastAPI, Response app = FastAPI() class CustomORJSONResponse(Response): media_type = "application/json" def render(self, content: Any) -> bytes: assert orjson is not None, "orjson must be installed" return orjson.dumps(content, option=orjson.OPT_INDENT_2) @app.get("/", response_class=CustomORJSONResponse) async def main():
Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Wed Dec 17 20:41:43 GMT 2025 - 451 bytes - Click Count (0) -
fastapi/params.py
Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Sat Dec 27 12:54:56 GMT 2025 - 26.3K bytes - Click Count (0) -
docs_src/additional_responses/tutorial004_py310.py
response_model=Item, responses={**responses, 200: {"content": {"image/png": {}}}}, ) async def read_item(item_id: str, img: bool | None = None): if img: return FileResponse("image.png", media_type="image/png") else:Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Wed Dec 10 08:55:32 GMT 2025 - 669 bytes - Click Count (0) -
docs/es/docs/advanced/custom-response.md
* `status_code` - Un código de estado HTTP `int`. * `headers` - Un `dict` de strings. * `media_type` - Un `str` que da el media type. Por ejemplo, `"text/html"`. FastAPI (de hecho Starlette) incluirá automáticamente un header Content-Length. También incluirá un header Content-Type, basado en el `media_type` y añadiendo un conjunto de caracteres para tipos de texto.
Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Wed Dec 17 20:41:43 GMT 2025 - 13.2K bytes - Click Count (0) -
fastapi/openapi/utils.py
) media_type = route_response_media_type or "application/json" additional_schema = ( process_response.setdefault("content", {}) .setdefault(media_type, {}) .setdefault("schema", {}) )Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Sat Dec 27 12:54:56 GMT 2025 - 23.2K bytes - Click Count (0) -
docs_src/additional_responses/tutorial002_py310.py
"description": "Return the JSON item or an image.", } }, ) async def read_item(item_id: str, img: bool | None = None): if img: return FileResponse("image.png", media_type="image/png") else:
Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Wed Dec 10 08:55:32 GMT 2025 - 596 bytes - Click Count (0) -
docs_src/custom_response/tutorial008_py39.py
Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Wed Dec 17 20:41:43 GMT 2025 - 360 bytes - Click Count (0)