- Sort Score
- Num 10 results
- Language All
Results 1 - 10 of 91 for media_type (0.06 seconds)
The search processing time has exceeded the limit. The displayed results may be partial.
-
docs/en/docs/reference/responses.md
- media_type - body - background - raw_headers - render - init_headers - headers - set_cookie - delete_cookie ::: fastapi.responses.PlainTextResponse options: members: - charset - status_code - media_type - bodyCreated: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Sun Feb 22 16:34:59 GMT 2026 - 4.4K bytes - Click Count (0) -
fastapi/params.py
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Sun Mar 15 11:44:39 GMT 2026 - 25.7K bytes - Click Count (0) -
fastapi/.agents/skills/fastapi/references/streaming.md
```python from fastapi import FastAPI from fastapi.responses import StreamingResponse from app.utils import read_image app = FastAPI() class PNGStreamingResponse(StreamingResponse): media_type = "image/png" @app.get("/image", response_class=PNGStreamingResponse) def stream_image_no_async_no_annotation(): with read_image() as image_file: yield from image_file ```
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Sun Mar 01 10:05:57 GMT 2026 - 2.5K bytes - Click Count (0) -
docs_src/response_directly/tutorial002_py310.py
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Thu Feb 12 13:19:43 GMT 2026 - 354 bytes - Click Count (0) -
docs_src/custom_response/tutorial009c_py310.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 Apr 05 07:19:11 GMT 2026 - Last Modified: Thu Feb 12 13:19:43 GMT 2026 - 451 bytes - Click Count (0) -
docs_src/custom_response/tutorial008_py310.py
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Thu Feb 12 13:19:43 GMT 2026 - 360 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 Apr 05 07:19:11 GMT 2026 - Last Modified: Wed Dec 10 08:55:32 GMT 2025 - 669 bytes - Click Count (0) -
docs_src/stream_data/tutorial002_py310.py
binary_image = base64.b64decode(image_base64) def read_image() -> BytesIO: return BytesIO(binary_image) app = FastAPI() class PNGStreamingResponse(StreamingResponse): media_type = "image/png" @app.get("/image/stream", response_class=PNGStreamingResponse) async def stream_image() -> AsyncIterable[bytes]: with read_image() as image_file: for chunk in image_file:
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Fri Feb 27 20:51:40 GMT 2026 - 5.6K bytes - Click Count (0) -
docs/en/docs/advanced/custom-response.md
* `content` - A `str` or `bytes`. * `status_code` - An `int` HTTP status code. * `headers` - A `dict` of strings. * `media_type` - A `str` giving the media type. E.g. `"text/html"`. FastAPI (actually Starlette) will automatically include a Content-Length header. It will also include a Content-Type header, based on the `media_type` and appending a charset for text types. {* ../../docs_src/response_directly/tutorial002_py310.py hl[1,18] *}Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Thu Mar 05 18:13:19 GMT 2026 - 11K bytes - Click Count (0) -
fastapi/param_functions.py
""" ), ], ) -> Any: return params.Body( default=default, default_factory=default_factory, embed=embed, media_type=media_type, alias=alias, alias_priority=alias_priority, validation_alias=validation_alias, serialization_alias=serialization_alias, title=title,Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Sun Mar 15 11:44:39 GMT 2026 - 68K bytes - Click Count (0)