Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 12 for Dost (0.22 sec)

  1. docs_src/app_testing/app_b/main.py

            raise HTTPException(status_code=400, detail="Invalid X-Token header")
        if item_id not in fake_db:
            raise HTTPException(status_code=404, detail="Item not found")
        return fake_db[item_id]
    
    
    @app.post("/items/", response_model=Item)
    async def create_item(item: Item, x_token: str = Header()):
        if x_token != fake_secret_token:
            raise HTTPException(status_code=400, detail="Invalid X-Token header")
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Tue Jan 09 14:44:08 GMT 2024
    - 1.1K bytes
    - Viewed (0)
  2. docs_src/sql_databases_peewee/sql_app/main.py

    
    def get_db(db_state=Depends(reset_db_state)):
        try:
            database.db.connect()
            yield
        finally:
            if not database.db.is_closed():
                database.db.close()
    
    
    @app.post("/users/", response_model=schemas.User, dependencies=[Depends(get_db)])
    def create_user(user: schemas.UserCreate):
        db_user = crud.get_user_by_email(email=user.email)
        if db_user:
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Thu Mar 26 19:09:53 GMT 2020
    - 2.2K bytes
    - Viewed (0)
  3. .github/actions/people/app/main.py

        # category_id is only used by one query, but GraphQL allows unused variables, so
        # keep it here for simplicity
        variables = {"after": after, "category_id": category_id}
        response = httpx.post(
            github_graphql_url,
            headers=headers,
            timeout=settings.httpx_timeout,
            json={"query": query, "variables": variables, "operationName": "Q"},
        )
        if response.status_code != 200:
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Tue Mar 26 17:38:21 GMT 2024
    - 19.2K bytes
    - Viewed (1)
  4. .github/actions/notify-translations/app/main.py

            "category_id": category_id,
            "discussion_number": discussion_number,
            "discussion_id": discussion_id,
            "comment_id": comment_id,
            "body": body,
        }
        response = httpx.post(
            github_graphql_url,
            headers=headers,
            timeout=settings.httpx_timeout,
            json={"query": query, "variables": variables, "operationName": "Q"},
        )
        if response.status_code != 200:
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Wed Sep 27 23:01:46 GMT 2023
    - 12.4K bytes
    - Viewed (0)
  5. docs_src/sql_databases/sql_app_py39/main.py

    models.Base.metadata.create_all(bind=engine)
    
    app = FastAPI()
    
    
    # Dependency
    def get_db():
        db = SessionLocal()
        try:
            yield db
        finally:
            db.close()
    
    
    @app.post("/users/", response_model=schemas.User)
    def create_user(user: schemas.UserCreate, db: Session = Depends(get_db)):
        db_user = crud.get_user_by_email(db, email=user.email)
        if db_user:
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Fri Jan 07 14:11:31 GMT 2022
    - 1.6K bytes
    - Viewed (0)
  6. .github/actions/comment-docs-preview-in-pr/app/main.py

        }
        url = f"{github_api}/repos/{settings.github_repository}/issues/{use_pr.number}/comments"
        logging.info(f"Using comments URL: {url}")
        response = httpx.post(
            url,
            headers=github_headers,
            json={
                "body": f"📝 Docs preview for commit {use_pr.head.sha} at: {settings.input_deploy_url}"
            },
        )
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Tue Jan 09 15:02:53 GMT 2024
    - 2.1K bytes
    - Viewed (0)
  7. docs_src/sql_databases/sql_app/main.py

    models.Base.metadata.create_all(bind=engine)
    
    app = FastAPI()
    
    
    # Dependency
    def get_db():
        db = SessionLocal()
        try:
            yield db
        finally:
            db.close()
    
    
    @app.post("/users/", response_model=schemas.User)
    def create_user(user: schemas.UserCreate, db: Session = Depends(get_db)):
        db_user = crud.get_user_by_email(db, email=user.email)
        if db_user:
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Sun May 17 10:14:14 GMT 2020
    - 1.6K bytes
    - Viewed (0)
  8. docs_src/app_testing/app_b_an_py39/main.py

            raise HTTPException(status_code=400, detail="Invalid X-Token header")
        if item_id not in fake_db:
            raise HTTPException(status_code=404, detail="Item not found")
        return fake_db[item_id]
    
    
    @app.post("/items/", response_model=Item)
    async def create_item(item: Item, x_token: Annotated[str, Header()]):
        if x_token != fake_secret_token:
            raise HTTPException(status_code=400, detail="Invalid X-Token header")
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Sat Mar 18 12:29:59 GMT 2023
    - 1.1K bytes
    - Viewed (0)
  9. docs_src/app_testing/app_b_an_py310/main.py

            raise HTTPException(status_code=400, detail="Invalid X-Token header")
        if item_id not in fake_db:
            raise HTTPException(status_code=404, detail="Item not found")
        return fake_db[item_id]
    
    
    @app.post("/items/", response_model=Item)
    async def create_item(item: Item, x_token: Annotated[str, Header()]):
        if x_token != fake_secret_token:
            raise HTTPException(status_code=400, detail="Invalid X-Token header")
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Sat Mar 18 12:29:59 GMT 2023
    - 1.1K bytes
    - Viewed (0)
  10. docs_src/sql_databases/sql_app_py310/main.py

    models.Base.metadata.create_all(bind=engine)
    
    app = FastAPI()
    
    
    # Dependency
    def get_db():
        db = SessionLocal()
        try:
            yield db
        finally:
            db.close()
    
    
    @app.post("/users/", response_model=schemas.User)
    def create_user(user: schemas.UserCreate, db: Session = Depends(get_db)):
        db_user = crud.get_user_by_email(db, email=user.email)
        if db_user:
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Fri Jan 07 14:11:31 GMT 2022
    - 1.6K bytes
    - Viewed (0)
Back to top