- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 25 for Closed (0.2 sec)
-
docs/en/docs/advanced/custom-response.md
{!../../../docs_src/custom_response/tutorial008.py!} ``` 1. This is the generator function. It's a "generator function" because it contains `yield` statements inside. 2. By using a `with` block, we make sure that the file-like object is closed after the generator function is done. So, after it finishes sending the response.
Plain Text - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Thu Apr 18 19:53:19 GMT 2024 - 11.7K bytes - Viewed (0) -
docs/en/docs/advanced/websockets.md
With that you can connect the WebSocket and then send and receive messages: <img src="/img/tutorial/websockets/image05.png"> ## Handling disconnections and multiple clients When a WebSocket connection is closed, the `await websocket.receive_text()` will raise a `WebSocketDisconnect` exception, which you can then catch and handle like in this example. === "Python 3.9+" ```Python hl_lines="79-81"
Plain Text - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Thu May 02 22:37:31 GMT 2024 - 6.2K bytes - Viewed (0) -
docs/en/docs/contributing.md
## Developing If you already cloned the <a href="https://github.com/tiangolo/fastapi" class="external-link" target="_blank">fastapi repository</a> and you want to deep dive in the code, here are some guidelines to set up your environment. ### Virtual environment with `venv` You can create an isolated virtual local environment in a directory using Python's `venv` module. Let's do this in the cloned repository (where the `requirements.txt` is):
Plain Text - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Thu Jan 11 17:42:43 GMT 2024 - 14.1K bytes - Viewed (0) -
docs/em/docs/tutorial/request-files.md
* `read(size)`: โ `size` (`int`) ๐ข/๐ฆน ๐. * `seek(offset)`: ๐ถ ๐ข ๐ง `offset` (`int`) ๐. * ๐คถ โ., `await myfile.seek(0)` ๐ ๐ถ โถ๏ธ ๐. * ๐ โด๏ธ โ ๐ฅ ๐ ๐ `await myfile.read()` ๐ & โคด๏ธ ๐ช โ ๐ ๐. * `close()`: ๐ ๐. ๐ ๐ซ ๐ฉโ๐ฌ `async` ๐ฉโ๐ฌ, ๐ ๐ช "โ" ๐ซ. ๐ผ, ๐ `async` *โก ๐ ๏ธ ๐ข* ๐ ๐ช ๐ค ๐ โฎ๏ธ: ```Python contents = await myfile.read() ```
Plain Text - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Wed Mar 13 19:02:19 GMT 2024 - 6.6K bytes - Viewed (0) -
docs/ko/docs/tutorial/request-files.md
* `read(size)`: ํ์ผ์ ๋ฐ์ดํธ ๋ฐ ๊ธ์์ `size`(`int`)๋ฅผ ์ฝ์ต๋๋ค. * `seek(offset)`: ํ์ผ ๋ด `offset`(`int`) ์์น์ ๋ฐ์ดํธ๋ก ์ด๋ํฉ๋๋ค. * ์) `await myfile.seek(0)` ๋ฅผ ์ฌ์ฉํ๋ฉด ํ์ผ์ ์์๋ถ๋ถ์ผ๋ก ์ด๋ํฉ๋๋ค. * `await myfile.read()` ๋ฅผ ์ฌ์ฉํ ํ ๋ด์ฉ์ ๋ค์ ์ฝ์ ๋ ์ ์ฉํฉ๋๋ค. * `close()`: ํ์ผ์ ๋ซ์ต๋๋ค. ์๊ธฐ ๋ชจ๋ ๋ฉ์๋๋ค์ด `async` ๋ฉ์๋์ด๊ธฐ ๋๋ฌธ์ โawaitโ์ ์ฌ์ฉํ์ฌ์ผ ํฉ๋๋ค. ์๋ฅผ๋ค์ด, `async` *๊ฒฝ๋ก ์๋ ํจ์*์ ๋ด๋ถ์์ ๋ค์๊ณผ ๊ฐ์ ๋ฐฉ์์ผ๋ก ๋ด์ฉ์ ๊ฐ์ ธ์ฌ ์ ์์ต๋๋ค: ```Python contents = await myfile.read() ```
Plain Text - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Wed Mar 13 19:02:19 GMT 2024 - 8.1K bytes - Viewed (0) -
docs/en/docs/alternatives.md
Routes are declared in a single place, using functions declared in other places (instead of using decorators that can be placed right on top of the function that handles the endpoint). This is closer to how Django does it than to how Flask (and Starlette) does it. It separates in the code things that are relatively tightly coupled. !!! check "Inspired **FastAPI** to"
Plain Text - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Thu Apr 18 19:53:19 GMT 2024 - 23.2K bytes - Viewed (0) -
docs/en/docs/tutorial/sql-databases.md
``` !!! info We put the creation of the `SessionLocal()` and handling of the requests in a `try` block. And then we close it in the `finally` block. This way we make sure the database session is always closed after the request. Even if there was an exception while processing the request.
Plain Text - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Thu Apr 18 19:53:19 GMT 2024 - 29.6K bytes - Viewed (0) -
docs/en/docs/reference/uploadfile.md
members: - file - filename - size - headers - content_type - read - write - seek
Plain Text - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Thu Apr 18 19:53:19 GMT 2024 - 472 bytes - Viewed (0) -
docs/en/docs/reference/websockets.md
- receive_bytes - receive_json - iter_text - iter_bytes - iter_json - send_text - send_bytes - send_json - close When a client disconnects, a `WebSocketDisconnect` exception is raised, you can catch it. You can import it directly form `fastapi`: ```python from fastapi import WebSocketDisconnect ```
Plain Text - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Thu Apr 18 19:53:19 GMT 2024 - 1.6K bytes - Viewed (0) -
docs/em/docs/tutorial/dependencies/dependencies-with-yield.md
# ๐ โฎ๏ธ ๐พ FastAPI ๐โ๐ฆบ ๐ ๐ <abbr title='sometimes also called "exit", "cleanup", "teardown", "close", "context managers", ...'>โ ๐ โฎ๏ธ ๐</abbr>. ๐, โ๏ธ `yield` โฉ๏ธ `return`, & โ โ ๐ โฎ๏ธ. !!! tip โ ๐ญ โ๏ธ `yield` 1๏ธโฃ ๐ ๐ฐ. !!! note "๐ก โน" ๐ ๐ข ๐ โ โ๏ธ โฎ๏ธ: * <a href="https://docs.python.org/3/library/contextlib.html#contextlib.contextmanager" class="external-link" target="_blank">`@contextlib.contextmanager`</a> โ๏ธ
Plain Text - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Thu Apr 18 19:53:19 GMT 2024 - 8.6K bytes - Viewed (0)