- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 172 for sync (0.27 sec)
-
tests/test_dependency_contextmanager.py
@app.get("/sync_async_raise") def get_sync_async_raise(state: str = Depends(asyncgen_state_try)): assert state == "asyncgen raise started" raise AsyncDependencyError() @app.get("/sync_sync_raise") def get_sync_sync_raise(state: str = Depends(generator_state_try)): assert state == "generator raise started" raise SyncDependencyError() @app.get("/sync_async_raise_other")
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Sat Feb 24 23:06:37 GMT 2024 - 11.6K bytes - Viewed (0) -
fastapi/concurrency.py
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Mon Dec 25 17:57:35 GMT 2023 - 1.4K bytes - Viewed (0) -
docs_src/security/tutorial003_an_py39.py
return user async def get_current_user(token: Annotated[str, Depends(oauth2_scheme)]): user = fake_decode_token(token) if not user: raise HTTPException( status_code=status.HTTP_401_UNAUTHORIZED, detail="Invalid authentication credentials", headers={"WWW-Authenticate": "Bearer"}, ) return user async def get_current_active_user(
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Tue Mar 26 16:56:53 GMT 2024 - 2.5K bytes - Viewed (0) -
docs_src/security/tutorial004.py
if user is None: raise credentials_exception return user async def get_current_active_user(current_user: User = Depends(get_current_user)): if current_user.disabled: raise HTTPException(status_code=400, detail="Inactive user") return current_user @app.post("/token") async def login_for_access_token( form_data: OAuth2PasswordRequestForm = Depends(), ) -> Token:
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Tue Mar 26 16:56:53 GMT 2024 - 4K bytes - Viewed (0) -
docs_src/security/tutorial004_an.py
if user is None: raise credentials_exception return user async def get_current_active_user( current_user: Annotated[User, Depends(get_current_user)], ): if current_user.disabled: raise HTTPException(status_code=400, detail="Inactive user") return current_user @app.post("/token") async def login_for_access_token( form_data: Annotated[OAuth2PasswordRequestForm, Depends()],
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Tue Mar 26 16:56:53 GMT 2024 - 4.1K bytes - Viewed (0) -
docs/en/docs/advanced/dataclasses.md
8. Notice that this *path operation function* uses regular `def` instead of `async def`. As always, in FastAPI you can combine `def` and `async def` as needed. If you need a refresher about when to use which, check out the section _"In a hurry?"_ in the docs about [`async` and `await`](../async.md#in-a-hurry){.internal-link target=_blank}.
Plain Text - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Thu Apr 18 19:53:19 GMT 2024 - 4.1K bytes - Viewed (0) -
docs_src/app_testing/app_b/main.py
@app.get("/items/{item_id}", response_model=Item) async def read_main(item_id: str, x_token: str = Header()): if x_token != fake_secret_token: raise HTTPException(status_code=400, detail="Invalid X-Token header") if item_id not in fake_db: raise HTTPException(status_code=404, detail="Item not found") return fake_db[item_id] @app.post("/items/", response_model=Item) async def create_item(item: Item, x_token: str = Header()):
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Tue Jan 09 14:44:08 GMT 2024 - 1.1K bytes - Viewed (0) -
docs/em/docs/tutorial/request-files.md
* `close()`: ๐ ๐. ๐ ๐ซ ๐ฉโ๐ฌ `async` ๐ฉโ๐ฌ, ๐ ๐ช "โ" ๐ซ. ๐ผ, ๐ `async` *โก ๐ ๏ธ ๐ข* ๐ ๐ช ๐ค ๐ โฎ๏ธ: ```Python contents = await myfile.read() ``` ๐ฅ ๐ ๐ ๐ `def` *โก ๐ ๏ธ ๐ข*, ๐ ๐ช ๐ `UploadFile.file` ๐, ๐ผ: ```Python contents = myfile.file.read() ``` !!! note "`async` ๐ก โน" ๐โ ๐ โ๏ธ `async` ๐ฉโ๐ฌ, **FastAPI** ๐ ๐ ๐ฉโ๐ฌ ๐งต & โ ๐ซ. !!! note "๐ ๐ก โน"
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
* `close()`: ํ์ผ์ ๋ซ์ต๋๋ค. ์๊ธฐ ๋ชจ๋ ๋ฉ์๋๋ค์ด `async` ๋ฉ์๋์ด๊ธฐ ๋๋ฌธ์ โawaitโ์ ์ฌ์ฉํ์ฌ์ผ ํฉ๋๋ค. ์๋ฅผ๋ค์ด, `async` *๊ฒฝ๋ก ์๋ ํจ์*์ ๋ด๋ถ์์ ๋ค์๊ณผ ๊ฐ์ ๋ฐฉ์์ผ๋ก ๋ด์ฉ์ ๊ฐ์ ธ์ฌ ์ ์์ต๋๋ค: ```Python contents = await myfile.read() ``` ๋ง์ฝ ์ผ๋ฐ์ ์ธ `def` *๊ฒฝ๋ก ์๋ ํจ์*์ ๋ด๋ถ๋ผ๋ฉด, ๋ค์๊ณผ ๊ฐ์ด `UploadFile.file` ์ ์ง์ ์ ๊ทผํ ์ ์์ต๋๋ค: ```Python contents = myfile.file.read() ``` !!! note "`async` ๊ธฐ์ ์ ์ธ๋ถ์ฌํญ" `async` ๋ฉ์๋๋ค์ ์ฌ์ฉํ ๋ **FastAPI**๋ ์ค๋ ๋ํ์์ ํ์ผ ๋ฉ์๋๋ค์ ์คํํ๊ณ ๊ทธ๋ค์ ๊ธฐ๋ค๋ฆฝ๋๋ค.
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/tutorial/testing.md
!!! tip If you want to call `async` functions in your tests apart from sending requests to your FastAPI application (e.g. asynchronous database functions), have a look at the [Async Tests](../advanced/async-tests.md){.internal-link target=_blank} in the advanced tutorial. ## Separating tests
Plain Text - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Thu Apr 18 19:53:19 GMT 2024 - 6.2K bytes - Viewed (0)