- Sort Score
- Result 10 results
- Languages All
Results 11 - 17 of 17 for POST (0.15 sec)
-
docs_src/openapi_webhooks/tutorial001.py
app = FastAPI() class Subscription(BaseModel): username: str monthly_fee: float start_date: datetime @app.webhooks.post("new-subscription") def new_subscription(body: Subscription): """ When a new user subscribes to your service we'll send you a POST request with this data to the URL that you register for the event `new-subscription` in the dashboard. """ @app.get("/users/")
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Fri Oct 20 09:00:44 GMT 2023 - 550 bytes - Viewed (0) -
docs_src/response_status_code/tutorial001.py
from fastapi import FastAPI app = FastAPI() @app.post("/items/", status_code=201) async def create_item(name: str):
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Thu Mar 26 19:09:53 GMT 2020 - 145 bytes - Viewed (0) -
docs_src/dataclasses/tutorial001.py
from fastapi import FastAPI @dataclass class Item: name: str price: float description: Union[str, None] = None tax: Union[float, None] = None app = FastAPI() @app.post("/items/") async def create_item(item: Item):
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Sat May 14 11:59:59 GMT 2022 - 312 bytes - Viewed (0) -
docs_src/path_operation_configuration/tutorial001.py
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Sat May 14 11:59:59 GMT 2022 - 406 bytes - Viewed (0) -
docs_src/body/tutorial001.py
from pydantic import BaseModel class Item(BaseModel): name: str description: Union[str, None] = None price: float tax: Union[float, None] = None app = FastAPI() @app.post("/items/") async def create_item(item: Item):
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Sat May 14 11:59:59 GMT 2022 - 309 bytes - Viewed (0) -
docs_src/background_tasks/tutorial001.py
app = FastAPI() def write_notification(email: str, message=""): with open("log.txt", mode="w") as email_file: content = f"notification for {email}: {message}" email_file.write(content) @app.post("/send-notification/{email}") async def send_notification(email: str, background_tasks: BackgroundTasks): background_tasks.add_task(write_notification, email, message="some notification")
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Thu Mar 26 19:09:53 GMT 2020 - 519 bytes - Viewed (0) -
docs_src/extra_models/tutorial001.py
hashed_password = fake_password_hasher(user_in.password) user_in_db = UserInDB(**user_in.dict(), hashed_password=hashed_password) print("User saved! ..not really") return user_in_db @app.post("/user/", response_model=UserOut) async def create_user(user_in: UserIn): user_saved = fake_save_user(user_in)
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Sat May 14 11:59:59 GMT 2022 - 943 bytes - Viewed (0)