- Sort Score
- Result 10 results
- Languages All
Results 541 - 550 of 1,926 for App (0.02 sec)
-
tests/test_tutorial/test_websockets/test_tutorial001.py
import pytest from fastapi.testclient import TestClient from fastapi.websockets import WebSocketDisconnect from docs_src.websockets.tutorial001_py39 import app client = TestClient(app) def test_main(): response = client.get("/") assert response.status_code == 200, response.text assert b"<!DOCTYPE html>" in response.content def test_websocket(): with pytest.raises(WebSocketDisconnect):
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Wed Dec 17 20:41:43 UTC 2025 - 827 bytes - Viewed (0) -
docs_src/sql_databases/tutorial001_an_py39.py
SessionDep = Annotated[Session, Depends(get_session)] app = FastAPI() @app.on_event("startup") def on_startup(): create_db_and_tables() @app.post("/heroes/") def create_hero(hero: Hero, session: SessionDep) -> Hero: session.add(hero) session.commit() session.refresh(hero) return hero @app.get("/heroes/") def read_heroes( session: SessionDep,
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Wed Oct 09 19:44:42 UTC 2024 - 1.7K bytes - Viewed (0) -
src/main/java/org/codelibs/fess/app/web/login/LoginAction.java
*/ package org.codelibs.fess.app.web.login; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.codelibs.core.lang.StringUtil; import org.codelibs.fess.app.service.UserService; import org.codelibs.fess.app.web.base.FessLoginAction; import org.codelibs.fess.app.web.base.login.LocalUserCredential; import org.codelibs.fess.app.web.profile.ProfileAction;
Registered: Sat Dec 20 09:19:18 UTC 2025 - Last Modified: Thu Nov 27 07:01:25 UTC 2025 - 7.2K bytes - Viewed (0) -
docs/pt/docs/tutorial/middleware.md
Quando você adiciona múltiplos middlewares usando o decorador `@app.middleware()` ou o método `app.add_middleware()`, cada novo middleware envolve a aplicação, formando uma pilha. O último middleware adicionado é o mais externo, e o primeiro é o mais interno. No caminho da requisição, o middleware mais externo roda primeiro. No caminho da resposta, ele roda por último. Por exemplo: ```Python app.add_middleware(MiddlewareA)
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Wed Dec 17 20:41:43 UTC 2025 - 4.4K bytes - Viewed (0) -
tests/test_modules_same_name_body/test_main.py
import pytest from fastapi.testclient import TestClient from .app.main import app client = TestClient(app) @pytest.mark.parametrize( "path", ["/a/compute", "/a/compute/", "/b/compute", "/b/compute/"] ) def test_post(path): data = {"a": 2, "b": "foo"} response = client.post(path, json=data) assert response.status_code == 200, response.text assert data == response.json() @pytest.mark.parametrize(
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Thu Feb 27 14:42:41 UTC 2025 - 5.5K bytes - Viewed (0) -
tests/test_tutorial/test_metadata/test_tutorial002.py
from fastapi.testclient import TestClient from docs_src.metadata.tutorial002_py39 import app client = TestClient(app) def test_items(): response = client.get("/items/") assert response.status_code == 200, response.text assert response.json() == [{"name": "Foo"}] def test_get_openapi_json_default_url(): response = client.get("/openapi.json") assert response.status_code == 404, response.text
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Fri Dec 26 10:43:02 UTC 2025 - 1.2K bytes - Viewed (0) -
docs_src/security/tutorial002_an_py39.py
from typing import Annotated, Union from fastapi import Depends, FastAPI from fastapi.security import OAuth2PasswordBearer from pydantic import BaseModel app = FastAPI() oauth2_scheme = OAuth2PasswordBearer(tokenUrl="token") class User(BaseModel): username: str email: Union[str, None] = None full_name: Union[str, None] = None disabled: Union[bool, None] = None def fake_decode_token(token):
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Sat Mar 18 12:29:59 UTC 2023 - 786 bytes - Viewed (0) -
docs/ru/docs/tutorial/testing.md
Кроме того, Ваше приложение **FastAPI** может состоять из нескольких файлов, модулей и т.п. ### Файл приложения **FastAPI** { #fastapi-app-file } Допустим, структура файлов Вашего приложения похожа на ту, что описана на странице [Более крупные приложения](bigger-applications.md){.internal-link target=_blank}: ``` . ├── app │ ├── __init__.py │ └── main.py ``` В файле `main.py` находится Ваше приложение **FastAPI**:Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Wed Dec 17 20:41:43 UTC 2025 - 10K bytes - Viewed (0) -
docs_src/additional_responses/tutorial002_py39.py
from typing import Union from fastapi import FastAPI from fastapi.responses import FileResponse from pydantic import BaseModel class Item(BaseModel): id: str value: str app = FastAPI() @app.get( "/items/{item_id}", response_model=Item, responses={ 200: { "content": {"image/png": {}}, "description": "Return the JSON item or an image.", } },
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Wed Dec 17 20:41:43 UTC 2025 - 628 bytes - Viewed (0) -
docs_src/schema_extra_example/tutorial004_an_py310.py
from typing import Annotated from fastapi import Body, FastAPI from pydantic import BaseModel app = FastAPI() class Item(BaseModel): name: str description: str | None = None price: float tax: float | None = None @app.put("/items/{item_id}") async def update_item( *, item_id: int, item: Annotated[ Item, Body( examples=[ {
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Sat Jul 01 16:43:29 UTC 2023 - 917 bytes - Viewed (0)