- Sort Score
- Result 10 results
- Languages All
Results 11 - 20 of 112 for raisin (2.08 sec)
-
docs_src/dependencies/tutorial006_an_py39.py
app = FastAPI() async def verify_token(x_token: Annotated[str, Header()]): if x_token != "fake-super-secret-token": raise HTTPException(status_code=400, detail="X-Token header invalid") async def verify_key(x_key: Annotated[str, Header()]): if x_key != "fake-super-secret-key": raise HTTPException(status_code=400, detail="X-Key header invalid") return x_key
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Sat Mar 18 12:29:59 GMT 2023 - 633 bytes - Viewed (0) -
docs_src/path_operation_advanced_configuration/tutorial007.py
raw_body = await request.body() try: data = yaml.safe_load(raw_body) except yaml.YAMLError: raise HTTPException(status_code=422, detail="Invalid YAML") try: item = Item.model_validate(data) except ValidationError as e: raise HTTPException(status_code=422, detail=e.errors(include_url=False))
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Thu Apr 18 19:40:57 GMT 2024 - 822 bytes - Viewed (0) -
docs_src/handling_errors/tutorial002.py
from fastapi import FastAPI, HTTPException app = FastAPI() items = {"foo": "The Foo Wrestlers"} @app.get("/items-header/{item_id}") async def read_item_header(item_id: str): if item_id not in items: raise HTTPException( status_code=404, detail="Item not found", headers={"X-Error": "There goes my error"}, )
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Thu Mar 26 19:09:53 GMT 2020 - 404 bytes - Viewed (0) -
docs/em/docs/tutorial/handling-errors.md
โก๏ธ ๐ฌ ๐ โ๏ธ ๐ โ `UnicornException` ๐ ๐ (โ๏ธ ๐ ๐ โ๏ธ) ๐ช `raise`. & ๐ ๐ ๐ต ๐ โ ๐ โฎ๏ธ FastAPI. ๐ ๐ช ๐ฎ ๐ โ ๐โ๐ฆบ โฎ๏ธ `@app.exception_handler()`: ```Python hl_lines="5-7 13-18 24" {!../../../docs_src/handling_errors/tutorial003.py!} ``` ๐ฅ, ๐ฅ ๐ ๐จ `/unicorns/yolo`, *โก ๐ ๏ธ* ๐ `raise` `UnicornException`. โ๏ธ โซ๏ธ ๐ ๐ต `unicorn_exception_handler`.
Plain Text - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Fri Mar 22 01:42:11 GMT 2024 - 8.3K bytes - Viewed (0) -
docs_src/handling_errors/tutorial006.py
print(f"OMG! The client sent invalid data!: {exc}") return await request_validation_exception_handler(request, exc) @app.get("/items/{item_id}") async def read_item(item_id: int): if item_id == 3: raise HTTPException(status_code=418, detail="Nope! I don't like 3.")
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Sun Aug 09 11:10:33 GMT 2020 - 928 bytes - Viewed (0) -
docs_src/security/tutorial007_an.py
correct_password_bytes = b"swordfish" is_correct_password = secrets.compare_digest( current_password_bytes, correct_password_bytes ) if not (is_correct_username and is_correct_password): raise HTTPException( status_code=status.HTTP_401_UNAUTHORIZED, detail="Incorrect username or password", headers={"WWW-Authenticate": "Basic"}, ) return credentials.username
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Tue Mar 26 16:56:53 GMT 2024 - 1.2K bytes - Viewed (0) -
docs_src/websockets/tutorial002_an_py310.py
async def get_cookie_or_token( websocket: WebSocket, session: Annotated[str | None, Cookie()] = None, token: Annotated[str | None, Query()] = None, ): if session is None and token is None: raise WebSocketException(code=status.WS_1008_POLICY_VIOLATION) return session or token @app.websocket("/items/{item_id}/ws") async def websocket_endpoint( *, websocket: WebSocket, item_id: str,
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Sat Mar 18 12:29:59 GMT 2023 - 2.8K bytes - Viewed (0) -
docs/zh/docs/tutorial/handling-errors.md
``` ### ่งฆๅ `HTTPException` `HTTPException` ๆฏ้ขๅคๅ ๅซไบๅ API ๆๅ ณๆฐๆฎ็ๅธธ่ง Python ๅผๅธธใ ๅ ไธบๆฏ Python ๅผๅธธ๏ผๆไปฅไธ่ฝ `return`๏ผๅช่ฝ `raise`ใ ๅฆๅจ่ฐ็จ*่ทฏๅพๆไฝๅฝๆฐ*้็ๅทฅๅ ทๅฝๆฐๆถ๏ผ่งฆๅไบ `HTTPException`๏ผFastAPI ๅฐฑไธๅ็ปง็ปญๆง่ก*่ทฏๅพๆไฝๅฝๆฐ*ไธญ็ๅ็ปญไปฃ็ ๏ผ่ๆฏ็ซๅณ็ปๆญข่ฏทๆฑ๏ผๅนถๆ `HTTPException` ็ HTTP ้่ฏฏๅ้่ณๅฎขๆท็ซฏใ ๅจไป็ปไพ่ต้กนไธๅฎๅ จ็็ซ ่ไธญ๏ผๆจๅฏไปฅไบ่งฃๆดๅค็จ `raise` ๅผๅธธไปฃๆฟ `return` ๅผ็ไผๅฟใ ๆฌไพไธญ๏ผๅฎขๆท็ซฏ็จ `ID` ่ฏทๆฑ็ `item` ไธๅญๅจๆถ๏ผ่งฆๅ็ถๆ็ ไธบ `404` ็ๅผๅธธ๏ผ ```Python hl_lines="11"
Plain Text - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Fri Mar 22 01:42:11 GMT 2024 - 8.4K bytes - Viewed (0) -
docs/em/docs/tutorial/dependencies/dependencies-in-path-operation-decorators.md
๐ ๐ช โ๏ธ ๐ ๐ *๐ข* ๐ โ๏ธ ๐. ### ๐ ๐ ๐ซ ๐ช ๐ฃ ๐จ ๐ (๐ ๐) โ๏ธ ๐ ๐ง-๐: ```Python hl_lines="6 11" {!../../../docs_src/dependencies/tutorial006.py!} ``` ### ๐ค โ ๐ซ ๐ ๐ช `raise` โ , ๐ ๐ ๐: ```Python hl_lines="8 13" {!../../../docs_src/dependencies/tutorial006.py!} ``` ### ๐จ ๐ฒ & ๐ซ ๐ช ๐จ ๐ฒ โ๏ธ ๐ซ, ๐ฒ ๐ ๐ซ โ๏ธ.
Plain Text - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Sat Apr 01 09:26:04 GMT 2023 - 2.2K bytes - Viewed (0) -
docs/ko/docs/tutorial/dependencies/dependencies-in-path-operation-decorators.md
!!! tip "ํ" ๊ฐ๋ฅํ๋ค๋ฉด `Annotated`๊ฐ ๋ฌ๋ฆฐ ๋ฒ์ ์ ๊ถ์ฅํฉ๋๋ค. ```Python hl_lines="6 11" {!> ../../../docs_src/dependencies/tutorial006.py!} ``` ### ์ค๋ฅ ๋ฐ์์ํค๊ธฐ ๋ค์ ์์กด์ฑ์ ๊ธฐ์กด ์์กด์ฑ๊ณผ ๋์ผํ๊ฒ ์์ธ๋ฅผ `raise`๋ฅผ ์ผ์ผํฌ ์ ์์ต๋๋ค: === "Python 3.9+" ```Python hl_lines="10 15" {!> ../../../docs_src/dependencies/tutorial006_an_py39.py!} ``` === "Python 3.8+" ```Python hl_lines="9 14"
Plain Text - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Sun Feb 11 13:49:45 GMT 2024 - 4.7K bytes - Viewed (0)