- Sort Score
- Result 10 results
- Languages All
Results 531 - 540 of 1,452 for DEF (0.02 sec)
-
docs/em/docs/advanced/dataclasses.md
7ī¸âŖ. đĨ `response_model` âī¸ đ â đ `Author` đģ. đ, đ đĒ đ `dataclasses` âŽī¸ đŠ đ â. 8ī¸âŖ. đ đ đ *⥠đ ī¸ đĸ* âī¸ đĨ `def` âŠī¸ `async def`. đ§, FastAPI đ đĒ đ `def` & `async def` đĒ. đĨ đ đĒ âī¸ đ đâ âī¸ â, â đ đ _"đ â" _ đŠē đ <a href="https://fastapi.tiangolo.com/async/#in-a-hurry" target="_blank" class="internal-link">`async` & `await`</a>.
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sun Oct 06 20:36:54 UTC 2024 - 3.4K bytes - Viewed (0) -
docs_src/response_model/tutorial001_01_py39.py
name: str description: Union[str, None] = None price: float tax: Union[float, None] = None tags: list[str] = [] @app.post("/items/") async def create_item(item: Item) -> Item: return item @app.get("/items/") async def read_items() -> list[Item]: return [ Item(name="Portal Gun", price=42.0), Item(name="Plumbus", price=32.0),
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sat Jan 07 13:45:48 UTC 2023 - 507 bytes - Viewed (0) -
docs_src/handling_errors/tutorial005.py
@app.exception_handler(RequestValidationError) async def validation_exception_handler(request: Request, exc: RequestValidationError): return JSONResponse( status_code=status.HTTP_422_UNPROCESSABLE_ENTITY, content=jsonable_encoder({"detail": exc.errors(), "body": exc.body}), ) class Item(BaseModel): title: str size: int @app.post("/items/") async def create_item(item: Item):
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Thu Mar 26 19:09:53 UTC 2020 - 667 bytes - Viewed (0) -
tests/test_tutorial/test_dependencies/test_tutorial008d.py
import pytest from fastapi.testclient import TestClient @pytest.fixture(name="client") def get_client(): from docs_src.dependencies.tutorial008d import app client = TestClient(app) return client def test_get_no_item(client: TestClient): response = client.get("/items/foo") assert response.status_code == 404, response.text assert response.json() == {"detail": "Item not found, there's only a plumbus here"}
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sat Feb 24 23:06:37 UTC 2024 - 1.2K bytes - Viewed (0) -
docs/em/docs/tutorial/dependencies/index.md
/// ## `async` âī¸ đĢ `async` đ đ đ¤ **FastAPI** (đ đ *⥠đ ī¸ đĸ*), đ đĢ â âĒ đŦ đ đĸ. đ đĒ âī¸ `async def` âī¸ đ `def`. & đ đĒ đŖ đ âŽī¸ `async def` đ đ `def` *⥠đ ī¸ đĸ*, âī¸ `def` đ đ `async def` *⥠đ ī¸ đĸ*, âī¸. âĢī¸ đĢ đ¤. **FastAPI** đ đ âĢī¸â. /// note
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sun Oct 06 20:36:54 UTC 2024 - 6.7K bytes - Viewed (0) -
tests/test_security_api_key_header.py
class User(BaseModel): username: str def get_current_user(oauth_header: str = Security(api_key)): user = User(username=oauth_header) return user @app.get("/users/me") def read_current_user(current_user: User = Depends(get_current_user)): return current_user client = TestClient(app) def test_security_api_key():
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Fri Jun 30 18:25:16 UTC 2023 - 1.8K bytes - Viewed (0) -
tests/test_tutorial/test_custom_response/test_tutorial001.py
from fastapi.testclient import TestClient from docs_src.custom_response.tutorial001 import app client = TestClient(app) def test_get_custom_response(): response = client.get("/items/") assert response.status_code == 200, response.text assert response.json() == [{"item_id": "Foo"}] def test_openapi_schema(): response = client.get("/openapi.json") assert response.status_code == 200, response.text
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Fri Jun 30 18:25:16 UTC 2023 - 1K bytes - Viewed (0) -
tests/test_tutorial/test_path_operation_advanced_configurations/test_tutorial002.py
from docs_src.path_operation_advanced_configuration.tutorial002 import app client = TestClient(app) def test_get(): response = client.get("/items/") assert response.status_code == 200, response.text assert response.json() == [{"item_id": "Foo"}] def test_openapi_schema(): response = client.get("/openapi.json") assert response.status_code == 200, response.text
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Fri Jun 30 18:25:16 UTC 2023 - 1020 bytes - Viewed (0) -
tests/test_tutorial/test_configure_swagger_ui/test_tutorial002.py
from fastapi.testclient import TestClient from docs_src.configure_swagger_ui.tutorial002 import app client = TestClient(app) def test_swagger_ui(): response = client.get("/docs") assert response.status_code == 200, response.text assert ( '"syntaxHighlight": false' not in response.text ), "not used parameters should not be included" assert ( '"syntaxHighlight.theme": "obsidian"' in response.text
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sat Aug 19 19:54:04 UTC 2023 - 1.5K bytes - Viewed (0) -
tests/test_security_api_key_header_description.py
class User(BaseModel): username: str def get_current_user(oauth_header: str = Security(api_key)): user = User(username=oauth_header) return user @app.get("/users/me") def read_current_user(current_user: User = Depends(get_current_user)): return current_user client = TestClient(app) def test_security_api_key():
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Fri Jun 30 18:25:16 UTC 2023 - 2K bytes - Viewed (0)