- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 63 for cdef (0.14 sec)
-
docs_src/app_testing/tutorial001.py
from fastapi import FastAPI from fastapi.testclient import TestClient app = FastAPI() @app.get("/") async def read_main(): return {"msg": "Hello World"} client = TestClient(app) def test_read_main(): response = client.get("/") assert response.status_code == 200
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Thu Mar 26 19:09:53 GMT 2020 - 334 bytes - Viewed (0) -
docs_src/events/tutorial001.py
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Thu Mar 26 19:09:53 GMT 2020 - 283 bytes - Viewed (0) -
docs_src/generate_clients/tutorial001.py
price: float class ResponseMessage(BaseModel): message: str @app.post("/items/", response_model=ResponseMessage) async def create_item(item: Item): return {"message": "item received"} @app.get("/items/", response_model=List[Item]) async def get_items(): return [ {"name": "Plumbus", "price": 3}, {"name": "Portal Gun", "price": 9001},
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Fri Mar 04 22:02:18 GMT 2022 - 519 bytes - Viewed (0) -
docs_src/first_steps/tutorial001.py
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Thu Mar 26 19:09:53 GMT 2020 - 117 bytes - Viewed (0) -
docs_src/python_types/tutorial001.py
def get_full_name(first_name, last_name): full_name = first_name.title() + " " + last_name.title() return full_name
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Thu Mar 26 19:09:53 GMT 2020 - 162 bytes - Viewed (0) -
docs_src/debugging/tutorial001.py
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Thu Mar 26 19:09:53 GMT 2020 - 223 bytes - Viewed (0) -
docs_src/middleware/tutorial001.py
import time from fastapi import FastAPI, Request app = FastAPI() @app.middleware("http") async def add_process_time_header(request: Request, call_next): start_time = time.time() response = await call_next(request) process_time = time.time() - start_time response.headers["X-Process-Time"] = str(process_time)
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Thu Mar 26 19:09:53 GMT 2020 - 349 bytes - Viewed (0) -
docs_src/graphql/tutorial001.py
import strawberry from fastapi import FastAPI from strawberry.asgi import GraphQL @strawberry.type class User: name: str age: int @strawberry.type class Query: @strawberry.field def user(self) -> User: return User(name="Patrick", age=100) schema = strawberry.Schema(query=Query) graphql_app = GraphQL(schema) app = FastAPI() app.add_route("/graphql", graphql_app)
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Sun Oct 03 18:00:28 GMT 2021 - 446 bytes - Viewed (0) -
docs_src/templates/tutorial001.py
app = FastAPI() app.mount("/static", StaticFiles(directory="static"), name="static") templates = Jinja2Templates(directory="templates") @app.get("/items/{id}", response_class=HTMLResponse) async def read_item(request: Request, id: str): return templates.TemplateResponse( request=request, name="item.html", context={"id": id}
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Tue Dec 26 20:12:34 GMT 2023 - 521 bytes - Viewed (0) -
docs_src/body_multiple_params/tutorial001.py
app = FastAPI() class Item(BaseModel): name: str description: Union[str, None] = None price: float tax: Union[float, None] = None @app.put("/items/{item_id}") async def update_item( *, item_id: int = Path(title="The ID of the item to get", ge=0, le=1000), q: Union[str, None] = None, item: Union[Item, None] = None, ): results = {"item_id": item_id} if q:
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Fri May 13 23:38:22 GMT 2022 - 596 bytes - Viewed (0)