Search Options

Results per page
Sort
Preferred Languages
Advance

Results 41 - 50 of 1,033 for isync (0.04 sec)

  1. docs_src/dependencies/tutorial006_an_py39.py

    from typing import Annotated
    
    from fastapi import Depends, FastAPI, Header, HTTPException
    
    app = FastAPI()
    
    
    async def verify_token(x_token: Annotated[str, Header()]):
        if x_token != "fake-super-secret-token":
            raise HTTPException(status_code=400, detail="X-Token header invalid")
    
    
    async def verify_key(x_key: Annotated[str, Header()]):
        if x_key != "fake-super-secret-key":
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Sat Mar 18 12:29:59 UTC 2023
    - 633 bytes
    - Viewed (0)
  2. docs_src/handling_errors/tutorial006.py

    app = FastAPI()
    
    
    @app.exception_handler(StarletteHTTPException)
    async def custom_http_exception_handler(request, exc):
        print(f"OMG! An HTTP error!: {repr(exc)}")
        return await http_exception_handler(request, exc)
    
    
    @app.exception_handler(RequestValidationError)
    async def validation_exception_handler(request, exc):
        print(f"OMG! The client sent invalid data!: {exc}")
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Sun Aug 09 11:10:33 UTC 2020
    - 928 bytes
    - Viewed (0)
  3. docs_src/security/tutorial005_py310.py

    @app.get("/users/me/", response_model=User)
    async def read_users_me(current_user: User = Depends(get_current_active_user)):
        return current_user
    
    
    @app.get("/users/me/items/")
    async def read_own_items(
        current_user: User = Security(get_current_active_user, scopes=["items"]),
    ):
        return [{"item_id": "Foo", "owner": current_user.username}]
    
    
    @app.get("/status/")
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Mon May 20 17:37:28 UTC 2024
    - 5.1K bytes
    - Viewed (0)
  4. src/internal/poll/fd_fsync_darwin.go

    package poll
    
    import (
    	"errors"
    	"internal/syscall/unix"
    	"syscall"
    )
    
    // Fsync invokes SYS_FCNTL with SYS_FULLFSYNC because
    // on OS X, SYS_FSYNC doesn't fully flush contents to disk.
    // See Issue #26650 as well as the man page for fsync on OS X.
    func (fd *FD) Fsync() error {
    	if err := fd.incref(); err != nil {
    		return err
    	}
    	defer fd.decref()
    	return ignoringEINTR(func() error {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Mar 07 19:20:48 UTC 2024
    - 850 bytes
    - Viewed (0)
  5. docs_src/bigger_applications/app_an/routers/items.py

        responses={404: {"description": "Not found"}},
    )
    
    
    fake_items_db = {"plumbus": {"name": "Plumbus"}, "gun": {"name": "Portal Gun"}}
    
    
    @router.get("/")
    async def read_items():
        return fake_items_db
    
    
    @router.get("/{item_id}")
    async def read_item(item_id: str):
        if item_id not in fake_items_db:
            raise HTTPException(status_code=404, detail="Item not found")
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Sat Mar 18 12:29:59 UTC 2023
    - 1011 bytes
    - Viewed (0)
  6. docs_src/request_files/tutorial003_py39.py

    from fastapi.responses import HTMLResponse
    
    app = FastAPI()
    
    
    @app.post("/files/")
    async def create_files(
        files: list[bytes] = File(description="Multiple files as bytes"),
    ):
        return {"file_sizes": [len(file) for file in files]}
    
    
    @app.post("/uploadfiles/")
    async def create_upload_files(
        files: list[UploadFile] = File(description="Multiple files as UploadFile"),
    ):
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Fri May 13 23:38:22 UTC 2022
    - 888 bytes
    - Viewed (0)
  7. src/internal/poll/fd_fsync_windows.go

    // Use of this source code is governed by a BSD-style
    // license that can be found in the LICENSE file.
    
    package poll
    
    import "syscall"
    
    // Fsync wraps syscall.Fsync.
    func (fd *FD) Fsync() error {
    	if err := fd.incref(); err != nil {
    		return err
    	}
    	defer fd.decref()
    	return syscall.Fsync(fd.Sysfd)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Nov 07 20:27:01 UTC 2018
    - 358 bytes
    - Viewed (0)
  8. docs_src/path_operation_configuration/tutorial006.py

    from fastapi import FastAPI
    
    app = FastAPI()
    
    
    @app.get("/items/", tags=["items"])
    async def read_items():
        return [{"name": "Foo", "price": 42}]
    
    
    @app.get("/users/", tags=["users"])
    async def read_users():
        return [{"username": "johndoe"}]
    
    
    @app.get("/elements/", tags=["items"], deprecated=True)
    async def read_elements():
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Thu Mar 26 19:09:53 UTC 2020
    - 365 bytes
    - Viewed (0)
  9. docs_src/security/tutorial004_py310.py

        if user is None:
            raise credentials_exception
        return user
    
    
    async def get_current_active_user(current_user: User = Depends(get_current_user)):
        if current_user.disabled:
            raise HTTPException(status_code=400, detail="Inactive user")
        return current_user
    
    
    @app.post("/token")
    async def login_for_access_token(
        form_data: OAuth2PasswordRequestForm = Depends(),
    ) -> Token:
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Mon May 20 17:37:28 UTC 2024
    - 4K bytes
    - Viewed (0)
  10. docs_src/dependencies/tutorial001_py310.py

    from fastapi import Depends, FastAPI
    
    app = FastAPI()
    
    
    async def common_parameters(q: str | None = None, skip: int = 0, limit: int = 100):
        return {"q": q, "skip": skip, "limit": limit}
    
    
    @app.get("/items/")
    async def read_items(commons: dict = Depends(common_parameters)):
        return commons
    
    
    @app.get("/users/")
    async def read_users(commons: dict = Depends(common_parameters)):
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Fri Jan 07 14:11:31 UTC 2022
    - 404 bytes
    - Viewed (0)
Back to top