Search Options

Display Count
Sort
Preferred Language
Advanced Search

Results 1 - 2 of 2 for new_subscription (0.1 seconds)

  1. tests/test_webhooks_security.py

    app = FastAPI()
    
    bearer_scheme = HTTPBearer()
    
    
    class Subscription(BaseModel):
        username: str
        monthly_fee: float
        start_date: datetime
    
    
    @app.webhooks.post("new-subscription")
    def new_subscription(
        body: Subscription, token: Annotated[str, Security(bearer_scheme)]
    ):
        """
        When a new user subscribes to your service we'll send you a POST request with this
    Created: Sun Dec 28 07:19:09 GMT 2025
    - Last Modified: Wed Dec 17 21:25:59 GMT 2025
    - 4.5K bytes
    - Click Count (0)
  2. docs_src/openapi_webhooks/tutorial001_py39.py

    from pydantic import BaseModel
    
    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.
        """
    
    
    Created: Sun Dec 28 07:19:09 GMT 2025
    - Last Modified: Wed Dec 17 20:41:43 GMT 2025
    - 550 bytes
    - Click Count (0)
Back to Top