- Sort Score
- Result 10 results
- Languages All
Results 611 - 620 of 1,916 for FastApi (0.05 sec)
-
tests/test_validate_response.py
from typing import Optional, Union import pytest from fastapi import FastAPI from fastapi.exceptions import ResponseValidationError from fastapi.testclient import TestClient from pydantic import BaseModel app = FastAPI() class Item(BaseModel): name: str price: Optional[float] = None owner_ids: Optional[list[int]] = None @app.get("/items/invalid", response_model=Item) def get_invalid():
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Wed Dec 17 21:25:59 UTC 2025 - 2K bytes - Viewed (0) -
docs_src/response_status_code/tutorial002_py39.py
from fastapi import FastAPI, status app = FastAPI() @app.post("/items/", status_code=status.HTTP_201_CREATED) async def create_item(name: str):
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Wed Dec 17 20:41:43 UTC 2025 - 173 bytes - Viewed (0) -
docs/de/docs/advanced/response-cookies.md
**FastAPI** bietet dieselben `starlette.responses` auch via `fastapi.responses` an, als Annehmlichkeit für Sie, den Entwickler. Die meisten verfügbaren Responses kommen aber direkt von Starlette. Und da die `Response` häufig zum Setzen von Headern und Cookies verwendet wird, stellt **FastAPI** diese auch unter `fastapi.Response` bereit. ///
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Wed Dec 17 20:41:43 UTC 2025 - 2.7K bytes - Viewed (0) -
docs/uk/docs/tutorial/index.md
Використання його у своєму редакторі – це те, що дійсно показує вам переваги FastAPI, бачите, як мало коду вам потрібно написати, всі перевірки типів, автозаповнення тощо. --- ## Встановлення FastAPI Першим кроком є встановлення FastAPI. Для туторіалу ви можете встановити його з усіма необов’язковими залежностями та функціями: <div class="termy"> ```console $ pip install "fastapi[all]" ---> 100% ``` </div>
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Tue Aug 06 04:48:30 UTC 2024 - 4.4K bytes - Viewed (0) -
docs/pt/docs/advanced/response-cookies.md
**FastAPI** fornece as mesmas `starlette.responses` em `fastapi.responses` apenas como uma conveniência para você, o desenvolvedor. Mas a maioria das respostas disponíveis vem diretamente do Starlette. E como o `Response` pode ser usado frequentemente para definir cabeçalhos e cookies, o **FastAPI** também o fornece em `fastapi.Response`. ///
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Wed Dec 17 20:41:43 UTC 2025 - 2.5K bytes - Viewed (0) -
tests/test_response_change_status_code.py
from fastapi import Depends, FastAPI, Response from fastapi.testclient import TestClient app = FastAPI() async def response_status_setter(response: Response): response.status_code = 201 async def parent_dep(result=Depends(response_status_setter)): return result @app.get("/", dependencies=[Depends(parent_dep)]) async def get_main(): return {"msg": "Hello World"} client = TestClient(app)
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Wed Apr 08 04:37:38 UTC 2020 - 589 bytes - Viewed (0) -
tests/test_stringified_annotations_simple.py
from __future__ import annotations from typing import Annotated from fastapi import Depends, FastAPI, Request from fastapi.testclient import TestClient from .utils import needs_py310 class Dep: def __call__(self, request: Request): return "test" @needs_py310 def test_stringified_annotations(): app = FastAPI() client = TestClient(app) @app.get("/test/")Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Wed Dec 17 21:25:59 UTC 2025 - 545 bytes - Viewed (0) -
docs/en/docs/advanced/additional-status-codes.md
/// /// note | Technical Details You could also use `from starlette.responses import JSONResponse`. **FastAPI** provides the same `starlette.responses` as `fastapi.responses` just as a convenience for you, the developer. But most of the available responses come directly from Starlette. The same with `status`. /// ## OpenAPI and API docs { #openapi-and-api-docs }Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Sun Aug 31 09:15:41 UTC 2025 - 2K bytes - Viewed (0) -
docs/ru/docs/advanced/testing-dependencies.md
Для таких случаев у вашего приложения **FastAPI** есть атрибут `app.dependency_overrides`, это простой `dict`. Чтобы переопределить зависимость для тестирования, укажите в качестве ключа исходную зависимость (функцию), а в качестве значения — ваше переопределение зависимости (другую функцию). Тогда **FastAPI** будет вызывать это переопределение вместо исходной зависимости.
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Tue Sep 30 11:37:11 UTC 2025 - 4.3K bytes - Viewed (0) -
tests/test_tutorial/test_body_nested_models/test_tutorial008.py
{"url": "http://fastapi.tiangolo.com/", "name": "FastAPI"}, ] response = client.post("/images/multiple", json=data) assert response.status_code == 200, response.text assert response.json() == data def test_post_invalid_list_item(client: TestClient): data = [{"url": "not a valid url", "name": "Example"}] response = client.post("/images/multiple", json=data)Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Fri Dec 26 10:43:02 UTC 2025 - 5.4K bytes - Viewed (0)