- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 13 for Lyding (0.23 sec)
-
docs_src/body_multiple_params/tutorial001_an.py
from typing import Union from fastapi import FastAPI, Path from pydantic import BaseModel from typing_extensions import Annotated 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: Annotated[int, Path(title="The ID of the item to get", ge=0, le=1000)],
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Sat Mar 18 12:29:59 GMT 2023 - 639 bytes - Viewed (0) -
docs_src/body_fields/tutorial001_an.py
from typing import Union from fastapi import Body, FastAPI from pydantic import BaseModel, Field from typing_extensions import Annotated app = FastAPI() class Item(BaseModel): name: str description: Union[str, None] = Field( default=None, title="The description of the item", max_length=300 ) price: float = Field(gt=0, description="The price must be greater than zero") tax: Union[float, None] = None
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Sat Mar 18 12:29:59 GMT 2023 - 611 bytes - Viewed (0) -
docs_src/cookie_params/tutorial001_an.py
from typing import Union from fastapi import Cookie, FastAPI from typing_extensions import Annotated app = FastAPI() @app.get("/items/") async def read_items(ads_id: Annotated[Union[str, None], Cookie()] = None):
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Sat Mar 18 12:29:59 GMT 2023 - 247 bytes - Viewed (0) -
docs_src/additional_status_codes/tutorial001_an.py
from typing import Union from fastapi import Body, FastAPI, status from fastapi.responses import JSONResponse from typing_extensions import Annotated app = FastAPI() items = {"foo": {"name": "Fighters", "size": 6}, "bar": {"name": "Tenders", "size": 3}} @app.put("/items/{item_id}") async def upsert_item( item_id: str, name: Annotated[Union[str, None], Body()] = None, size: Annotated[Union[int, None], Body()] = None, ):
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Sat Mar 18 12:29:59 GMT 2023 - 734 bytes - Viewed (0) -
docs_src/extra_data_types/tutorial001_an.py
from datetime import datetime, time, timedelta from typing import Union from uuid import UUID from fastapi import Body, FastAPI from typing_extensions import Annotated app = FastAPI() @app.put("/items/{item_id}") async def read_items( item_id: UUID, start_datetime: Annotated[datetime, Body()], end_datetime: Annotated[datetime, Body()], process_after: Annotated[timedelta, Body()],
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Fri Apr 19 00:11:40 GMT 2024 - 830 bytes - Viewed (0) -
docs_src/path_params_numeric_validations/tutorial001_an.py
from typing import Union from fastapi import FastAPI, Path, Query from typing_extensions import Annotated app = FastAPI() @app.get("/items/{item_id}") async def read_items( item_id: Annotated[int, Path(title="The ID of the item to get")], q: Annotated[Union[str, None], Query(alias="item-query")] = None, ): results = {"item_id": item_id} if q: results.update({"q": q})
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Sat Mar 18 12:29:59 GMT 2023 - 417 bytes - Viewed (0) -
docs_src/request_forms/tutorial001_an.py
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Sat Mar 18 12:29:59 GMT 2023 - 233 bytes - Viewed (0) -
docs_src/header_params/tutorial001_an.py
from typing import Union from fastapi import FastAPI, Header from typing_extensions import Annotated app = FastAPI() @app.get("/items/") async def read_items(user_agent: Annotated[Union[str, None], Header()] = None):
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Sat Mar 18 12:29:59 GMT 2023 - 259 bytes - Viewed (0) -
docs_src/security/tutorial001_an.py
from fastapi import Depends, FastAPI from fastapi.security import OAuth2PasswordBearer from typing_extensions import Annotated app = FastAPI() oauth2_scheme = OAuth2PasswordBearer(tokenUrl="token") @app.get("/items/") async def read_items(token: Annotated[str, Depends(oauth2_scheme)]):
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Sat Mar 18 12:29:59 GMT 2023 - 319 bytes - Viewed (0) -
docs_src/request_forms_and_files/tutorial001_an.py
from fastapi import FastAPI, File, Form, UploadFile from typing_extensions import Annotated app = FastAPI() @app.post("/files/") async def create_file( file: Annotated[bytes, File()], fileb: Annotated[UploadFile, File()], token: Annotated[str, Form()], ): return { "file_size": len(file), "token": token, "fileb_content_type": fileb.content_type,
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Sat Mar 18 12:29:59 GMT 2023 - 396 bytes - Viewed (0)