- Sort Score
- Num 10 results
- Language All
Results 1 - 10 of 27 for 418 (0.01 seconds)
The search processing time has exceeded the limit. The displayed results may be partial.
-
docs_src/handling_errors/tutorial003_py310.py
self.name = name app = FastAPI() @app.exception_handler(UnicornException) async def unicorn_exception_handler(request: Request, exc: UnicornException): return JSONResponse( status_code=418, content={"message": f"Oops! {exc.name} did something. There goes a rainbow..."}, ) @app.get("/unicorns/{name}") async def read_unicorn(name: str): if name == "yolo":
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Thu Feb 12 13:19:43 GMT 2026 - 626 bytes - Click Count (0) -
docs_src/bigger_applications/app_an_py310/main.py
app.include_router(users.router) app.include_router(items.router) app.include_router( admin.router, prefix="/admin", tags=["admin"], dependencies=[Depends(get_token_header)], responses={418: {"description": "I'm a teapot"}}, ) @app.get("/") async def root():
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Thu Feb 12 13:19:43 GMT 2026 - 552 bytes - Click Count (0) -
docs_src/handling_errors/tutorial006_py310.py
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.")
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Thu Feb 12 13:19:43 GMT 2026 - 928 bytes - Click Count (0) -
docs/en/docs/tutorial/handling-errors.md
Here, if you request `/unicorns/yolo`, the *path operation* will `raise` a `UnicornException`. But it will be handled by the `unicorn_exception_handler`. So, you will receive a clean error, with an HTTP status code of `418` and a JSON content of: ```JSON {"message": "Oops! yolo did something. There goes a rainbow..."} ``` /// note | Technical DetailsCreated: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Thu Mar 05 18:13:19 GMT 2026 - 8.9K bytes - Click Count (0) -
docs/en/docs/tutorial/bigger-applications.md
The result is that in our app, each of the *path operations* from the `admin` module will have: * The prefix `/admin`. * The tag `admin`. * The dependency `get_token_header`. * The response `418`. 🍵 But that will only affect that `APIRouter` in our app, not in any other code that uses it. So, for example, other projects could use the same `APIRouter` with a different authentication method.
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Sat Mar 07 09:29:03 GMT 2026 - 19.2K bytes - Click Count (0) -
docs/zh/docs/tutorial/bigger-applications.md
这样,原始的 `APIRouter` 将保持不变,因此我们仍然可以与组织中的其他项目共享相同的 `app/internal/admin.py` 文件。 结果是在我们的应用程序中,来自 `admin` 模块的每个*路径操作*都将具有: * `/admin` 前缀 。 * `admin` 标签。 * `get_token_header` 依赖项。 * `418` 响应。 🍵 但这只会影响我们应用中的 `APIRouter`,而不会影响使用它的任何其他代码。 因此,举例来说,其他项目能够以不同的身份认证方法使用相同的 `APIRouter`。 ### 包含一个*路径操作* { #include-a-path-operation } 我们还可以直接将*路径操作*添加到 `FastAPI` 应用中。Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Fri Mar 20 17:06:37 GMT 2026 - 19.5K bytes - Click Count (0) -
docs_src/handling_errors/tutorial004_py310.py
return PlainTextResponse(message, status_code=400) @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.")
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Thu Feb 12 13:19:43 GMT 2026 - 920 bytes - Click Count (0) -
docs/ru/docs/tutorial/handling-errors.md
Здесь, если запросить `/unicorns/yolo`, то *операция пути* вызовет `UnicornException`. Но оно будет обработано `unicorn_exception_handler`. Таким образом, вы получите чистую ошибку с кодом состояния HTTP `418` и содержимым JSON: ```JSON {"message": "Oops! yolo did something. There goes a rainbow..."} ``` /// note | Технические деталиCreated: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Thu Mar 19 17:56:20 GMT 2026 - 14K bytes - Click Count (0) -
docs/uk/docs/tutorial/handling-errors.md
Тут, якщо ви звернетеся до `/unicorns/yolo`, *операція шляху* згенерує (`raise`) `UnicornException`. Але вона буде оброблена функцією-обробником `unicorn_exception_handler`. Отже, ви отримаєте зрозумілу помилку з кодом статусу HTTP `418` і JSON-вмістом: ```JSON {"message": "Oops! yolo did something. There goes a rainbow..."} ``` /// note | Технічні деталіCreated: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Thu Mar 19 18:27:41 GMT 2026 - 13.9K bytes - Click Count (0) -
docs/tr/docs/tutorial/handling-errors.md
Burada `/unicorns/yolo` için request atarsanız, *path operation* bir `UnicornException` `raise` eder. Namun bu, `unicorn_exception_handler` tarafından handle edilir. Böylece HTTP status code’u `418` olan, JSON içeriği şu şekilde temiz bir hata response’u alırsınız: ```JSON {"message": "Oops! yolo did something. There goes a rainbow..."} ``` /// note | Teknik DetaylarCreated: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Fri Mar 20 07:53:17 GMT 2026 - 9.7K bytes - Click Count (0)