- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 41 for dumps (0.18 sec)
-
tests/test_ws_dependencies.py
await websocket.accept() await websocket.send_text(json.dumps(deps)) await websocket.close() @router.websocket("/router", dependencies=[create_dependency("routerindex")]) async def routerindex(websocket: WebSocket, deps: DepList): await websocket.accept() await websocket.send_text(json.dumps(deps)) await websocket.close()
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Sun Jun 11 20:35:39 GMT 2023 - 2.1K bytes - Viewed (0) -
docs/ru/docs/tutorial/encoder.md
Результатом её вызова является объект, который может быть закодирован с помощью функции из стандартной библиотеки Python – <a href="https://docs.python.org/3/library/json.html#json.dumps" class="external-link" target="_blank">`json.dumps()`</a>.
Plain Text - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Tue Jan 23 13:56:12 GMT 2024 - 2.8K bytes - Viewed (0) -
docs/uk/docs/tutorial/encoder.md
Plain Text - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Thu Apr 18 19:53:19 GMT 2024 - 2.6K bytes - Viewed (0) -
docs/en/docs/tutorial/encoder.md
The result of calling it is something that can be encoded with the Python standard <a href="https://docs.python.org/3/library/json.html#json.dumps" class="external-link" target="_blank">`json.dumps()`</a>. It doesn't return a large `str` containing the data in JSON format (as a string). It returns a Python standard data structure (e.g. a `dict`) with values and sub-values that are all compatible with JSON.
Plain Text - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Tue Oct 17 05:59:11 GMT 2023 - 1.8K bytes - Viewed (0) -
docs/zh/docs/tutorial/encoder.md
{!> ../../../docs_src/encoder/tutorial001.py!} ``` 在这个例子中,它将Pydantic模型转换为`dict`,并将`datetime`转换为`str`。 调用它的结果后就可以使用Python标准编码中的<a href="https://docs.python.org/3/library/json.html#json.dumps" class="external-link" target="_blank">`json.dumps()`</a>。 这个操作不会返回一个包含JSON格式(作为字符串)数据的庞大的`str`。它将返回一个Python标准数据结构(例如`dict`),其值和子值都与JSON兼容。 !!! note
Plain Text - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Tue Oct 17 05:59:11 GMT 2023 - 1.7K bytes - Viewed (0) -
docs/ja/docs/tutorial/encoder.md
```Python hl_lines="5 22" {!../../../docs_src/encoder/tutorial001.py!} ``` この例では、Pydanticモデルを`dict`に、`datetime`を`str`に変換します。 呼び出した結果は、Pythonの標準の<a href="https://docs.python.org/3/library/json.html#json.dumps" class="external-link" target="_blank">`json.dumps()`</a>でエンコードできるものです。 これはJSON形式のデータを含む大きな`str`を(文字列として)返しません。JSONと互換性のある値とサブの値を持つPython標準のデータ構造(例:`dict`)を返します。 !!! note "備考"
Plain Text - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Mon Jan 22 20:09:02 GMT 2024 - 1.9K bytes - Viewed (0) -
docs_src/custom_response/tutorial009c.py
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():
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Thu Sep 01 09:32:30 GMT 2022 - 451 bytes - Viewed (0) -
fastapi/responses.py
""" def render(self, content: Any) -> bytes: assert ujson is not None, "ujson must be installed to use UJSONResponse" return ujson.dumps(content, ensure_ascii=False).encode("utf-8") class ORJSONResponse(JSONResponse): """ JSON response using the high-performance orjson library to serialize data to JSON. Read more about it in the
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Wed Oct 18 12:36:40 GMT 2023 - 1.7K bytes - Viewed (0) -
tests/test_tutorial/test_custom_request_and_route/test_tutorial001.py
client = TestClient(app) @pytest.mark.parametrize("compress", [True, False]) def test_gzip_request(compress): n = 1000 headers = {} body = [1] * n data = json.dumps(body).encode() if compress: data = gzip.compress(data) headers["Content-Encoding"] = "gzip" headers["Content-Type"] = "application/json" response = client.post("/sum", content=data, headers=headers)
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Sun Nov 13 14:26:09 GMT 2022 - 886 bytes - Viewed (0) -
docs/em/docs/tutorial/encoder.md
``` 👉 🖼, ⚫️ 🔜 🗜 Pydantic 🏷 `dict`, & `datetime` `str`. 🏁 🤙 ⚫️ 🕳 👈 💪 🗜 ⏮️ 🐍 🐩 <a href="https://docs.python.org/3/library/json.html#json.dumps" class="external-link" target="_blank">`json.dumps()`</a>. ⚫️ 🚫 📨 ⭕ `str` ⚗ 💽 🎻 📁 (🎻). ⚫️ 📨 🐍 🐩 💽 📊 (✅ `dict`) ⏮️ 💲 & 🎧-💲 👈 🌐 🔗 ⏮️ 🎻. !!! note
Plain Text - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Sat Apr 01 09:26:04 GMT 2023 - 1.5K bytes - Viewed (0)