- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 67 for yolo (0.01 sec)
-
docs_src/handling_errors/tutorial003_py39.py
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": raise UnicornException(name=name)Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Wed Dec 17 20:41:43 UTC 2025 - 626 bytes - Viewed (0) -
tests/test_tutorial/test_handling_errors/test_tutorial003.py
assert response.json() == {"unicorn_name": "shinny"} def test_get_exception(): response = client.get("/unicorns/yolo") assert response.status_code == 418, response.text assert response.json() == { "message": "Oops! yolo did something. There goes a rainbow..." } def test_openapi_schema(): response = client.get("/openapi.json")
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Wed Dec 17 20:41:43 UTC 2025 - 3.2K bytes - Viewed (0) -
docs/es/docs/tutorial/handling-errors.md
{* ../../docs_src/handling_errors/tutorial003_py39.py hl[5:7,13:18,24] *} Aquí, si solicitas `/unicorns/yolo`, la *path operation* lanzará un `UnicornException`. Pero será manejado por el `unicorn_exception_handler`. Así que recibirás un error limpio, con un código de estado HTTP de `418` y un contenido JSON de: ```JSON {"message": "Oops! yolo did something. There goes a rainbow..."} ``` /// note | Nota TécnicaRegistered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Wed Dec 17 20:41:43 UTC 2025 - 9.7K bytes - Viewed (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 DetailsRegistered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Wed Dec 17 20:41:43 UTC 2025 - 9K bytes - Viewed (0) -
docs/zh/docs/tutorial/handling-errors.md
此时,可以用 `@app.exception_handler()` 添加自定义异常控制器: {* ../../docs_src/handling_errors/tutorial003.py hl[5:7,13:18,24] *} 请求 `/unicorns/yolo` 时,路径操作会触发 `UnicornException`。 但该异常将会被 `unicorn_exception_handler` 处理。 接收到的错误信息清晰明了,HTTP 状态码为 `418`,JSON 内容如下: ```JSON {"message": "Oops! yolo did something. There goes a rainbow..."} ``` /// note | 技术细节
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Sat Oct 11 17:48:49 UTC 2025 - 8.2K bytes - Viewed (0) -
docs/tr/docs/tutorial/static-files.md
# Statik Dosyalar `StaticFiles`'ı kullanarak statik dosyaları bir yol altında sunabilirsiniz. ## `StaticFiles` Kullanımı * `StaticFiles` sınıfını projenize dahil edin. * Bir `StaticFiles()` örneğini belirli bir yola bağlayın. {* ../../docs_src/static_files/tutorial001.py hl[2,6] *} /// note | Teknik Detaylar Projenize dahil etmek için `from starlette.staticfiles import StaticFiles` kullanabilirsiniz.Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Sat Oct 11 17:48:49 UTC 2025 - 1.8K bytes - Viewed (0) -
docs/es/docs/how-to/configure-swagger-ui.md
## Configuraciones solo de JavaScript { #javascript-only-settings } Swagger UI también permite otras configuraciones que son objetos **solo de JavaScript** (por ejemplo, funciones de JavaScript). FastAPI también incluye estas configuraciones `presets` solo de JavaScript: ```JavaScript presets: [ SwaggerUIBundle.presets.apis,Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Wed Dec 17 20:41:43 UTC 2025 - 3.2K bytes - Viewed (0) -
docs/es/docs/how-to/conditional-openapi.md
Eso no añade ninguna seguridad extra a tu API, las *path operations* seguirán estando disponibles donde están. Si hay una falla de seguridad en tu código, seguirá existiendo.
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Wed Dec 17 20:41:43 UTC 2025 - 2.6K bytes - Viewed (0) -
docs/es/docs/tutorial/body-multiple-params.md
/// info | Información `Body` también tiene todos los mismos parámetros de validación y metadatos extras que `Query`, `Path` y otros que verás luego. /// ## Embeber un solo parámetro de cuerpo { #embed-a-single-body-parameter } Supongamos que solo tienes un único parámetro de cuerpo `item` de un modelo Pydantic `Item`. Por defecto, **FastAPI** esperará su cuerpo directamente.Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Tue Dec 16 16:33:45 UTC 2025 - 5.2K bytes - Viewed (0) -
docs/es/docs/tutorial/encoder.md
Para eso, **FastAPI** proporciona una función `jsonable_encoder()`. ## Usando el `jsonable_encoder` { #using-the-jsonable-encoder } Imaginemos que tienes una base de datos `fake_db` que solo recibe datos compatibles con JSON. Por ejemplo, no recibe objetos `datetime`, ya que no son compatibles con JSON.Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Tue Dec 16 16:33:45 UTC 2025 - 1.8K bytes - Viewed (0)