- Sort Score
- Result 10 results
- Languages All
Results 11 - 20 of 147 for Krause (0.14 sec)
-
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) -
tests/test_tutorial/test_dependencies/test_tutorial008d_an.py
exc_info.value.args[0] == "The portal gun is too dangerous to be owned by Rick" ) def test_internal_server_error(): from docs_src.dependencies.tutorial008d_an import app client = TestClient(app, raise_server_exceptions=False) response = client.get("/items/portal-gun") assert response.status_code == 500, response.text
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Sat Feb 24 23:06:37 GMT 2024 - 1.2K bytes - Viewed (0) -
docs/ja/docs/tutorial/handling-errors.md
ใใชใ๏ผใพใใฏไฝฟ็จใใฆใใใฉใคใใฉใช๏ผใ`raise`ใใใใใใใชใใซในใฟใ ไพๅค`UnicornException`ใใใใจใใพใใใใ ใใใฆใใใฎไพๅคใFastAPIใงใฐใญใผใใซใซๅฆ็ใใใใจๆใใพใใ ใซในใฟใ ไพๅคใใณใใฉใ`@app.exception_handler()`ใง่ฟฝๅ ใใใใจใใงใใพใ: ```Python hl_lines="5 6 7 13 14 15 16 17 18 24" {!../../../docs_src/handling_errors/tutorial003.py!} ``` ใใใงใ`/unicorns/yolo`ใใชใฏใจในใใใใจใ*path operation*ใฏ`UnicornException`ใ`raise`ใใพใใ ใใใใใใใฏ`unicorn_exception_handler`ใงๅฆ็ใใใพใใ
Plain Text - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Fri Mar 22 01:42:11 GMT 2024 - 11.8K 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) -
fastapi/security/oauth2.py
async def __call__(self, request: Request) -> Optional[str]: authorization = request.headers.get("Authorization") if not authorization: if self.auto_error: raise HTTPException( status_code=HTTP_403_FORBIDDEN, detail="Not authenticated" ) else: return None return authorization
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Tue Apr 02 02:48:51 GMT 2024 - 21.1K bytes - Viewed (1) -
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)