Search Options

Display Count
Sort
Preferred Language
Advanced Search

Results 131 - 140 of 635 for asyncId (0.05 seconds)

The search processing time has exceeded the limit. The displayed results may be partial.

  1. docs/en/docs/tutorial/server-sent-events.md

    ///
    
    ### Non-async *path operation functions* { #non-async-path-operation-functions }
    
    You can also use regular `def` functions (without `async`), and use `yield` the same way.
    
    FastAPI will make sure it's run correctly so that it doesn't block the event loop.
    
    As in this case the function is not async, the right return type would be `Iterable[Item]`:
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Mar 05 18:13:19 GMT 2026
    - 4.6K bytes
    - Click Count (0)
  2. regression-test/src/androidTest/java/okhttp/regression/compare/ApacheHttpClientHttp2Test.kt

     * <http://www.apache.org/>.
     *
     */
    package okhttp.regression.compare
    
    import org.apache.hc.client5.http.async.methods.SimpleHttpRequests
    import org.apache.hc.client5.http.async.methods.SimpleHttpResponse
    import org.apache.hc.client5.http.impl.async.HttpAsyncClients
    import org.apache.hc.core5.concurrent.FutureCallback
    import org.apache.hc.core5.http.ProtocolVersion
    import org.junit.Assert
    Created: Fri Apr 03 11:42:14 GMT 2026
    - Last Modified: Sat Feb 07 06:56:34 GMT 2026
    - 2.6K bytes
    - Click Count (0)
  3. tests/test_response_model_default_factory.py

    
    @app.get(
        "/response_model_has_default_factory_return_dict",
        response_model=ResponseModel,
    )
    async def response_model_has_default_factory_return_dict():
        return {"code": 200}
    
    
    @app.get(
        "/response_model_has_default_factory_return_model",
        response_model=ResponseModel,
    )
    async def response_model_has_default_factory_return_model():
        return ResponseModel()
    
    
    client = TestClient(app)
    
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Sat Sep 20 18:51:40 GMT 2025
    - 1.2K bytes
    - Click Count (0)
  4. docs_src/path_operation_configuration/tutorial002_py310.py

        tax: float | None = None
        tags: set[str] = set()
    
    
    @app.post("/items/", tags=["items"])
    async def create_item(item: Item) -> Item:
        return item
    
    
    @app.get("/items/", tags=["items"])
    async def read_items():
        return [{"name": "Foo", "price": 42}]
    
    
    @app.get("/users/", tags=["users"])
    async def read_users():
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Wed Feb 04 12:07:26 GMT 2026
    - 524 bytes
    - Click Count (0)
  5. docs_src/security/tutorial003_an_py310.py

        return user
    
    
    async def get_current_user(token: Annotated[str, Depends(oauth2_scheme)]):
        user = fake_decode_token(token)
        if not user:
            raise HTTPException(
                status_code=status.HTTP_401_UNAUTHORIZED,
                detail="Not authenticated",
                headers={"WWW-Authenticate": "Bearer"},
            )
        return user
    
    
    async def get_current_active_user(
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Mon Nov 24 19:03:06 GMT 2025
    - 2.5K bytes
    - Click Count (0)
  6. docs_src/custom_request_and_route/tutorial002_py310.py

    from fastapi.routing import APIRoute
    
    
    class ValidationErrorLoggingRoute(APIRoute):
        def get_route_handler(self) -> Callable:
            original_route_handler = super().get_route_handler()
    
            async def custom_route_handler(request: Request) -> Response:
                try:
                    return await original_route_handler(request)
                except RequestValidationError as exc:
                    body = await request.body()
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Wed Dec 10 08:55:32 GMT 2025
    - 935 bytes
    - Click Count (0)
  7. docs_src/dependencies/tutorial006_an_py310.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":
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Feb 12 13:19:43 GMT 2026
    - 633 bytes
    - Click Count (0)
  8. docs_src/body_updates/tutorial002_py310.py

        "baz": {"name": "Baz", "description": None, "price": 50.2, "tax": 10.5, "tags": []},
    }
    
    
    @app.get("/items/{item_id}", response_model=Item)
    async def read_item(item_id: str):
        return items[item_id]
    
    
    @app.patch("/items/{item_id}")
    async def update_item(item_id: str, item: Item) -> Item:
        stored_item_data = items[item_id]
        stored_item_model = Item(**stored_item_data)
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Wed Feb 04 12:07:26 GMT 2026
    - 1009 bytes
    - Click Count (0)
  9. tests/test_strict_content_type_app_level.py

    from fastapi import FastAPI
    from fastapi.testclient import TestClient
    
    app_default = FastAPI()
    
    
    @app_default.post("/items/")
    async def app_default_post(data: dict):
        return data
    
    
    app_lax = FastAPI(strict_content_type=False)
    
    
    @app_lax.post("/items/")
    async def app_lax_post(data: dict):
        return data
    
    
    client_default = TestClient(app_default)
    client_lax = TestClient(app_lax)
    
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Mon Feb 23 17:45:20 GMT 2026
    - 1.1K bytes
    - Click Count (0)
  10. docs/zh/docs/tutorial/dependencies/index.md

    当你在**大型代码库**中,在**很多*路径操作***里反复使用**相同的依赖**时,这会特别有用。
    
    ## 要不要使用 `async`? { #to-async-or-not-to-async }
    
    由于依赖项也会由 **FastAPI** 调用(与*路径操作函数*相同),因此定义函数时同样的规则也适用。
    
    你可以使用 `async def` 或普通的 `def`。
    
    你可以在普通的 `def` *路径操作函数*中声明 `async def` 的依赖项;也可以在异步的 `async def` *路径操作函数*中声明普通的 `def` 依赖项,等等。
    
    都没关系,**FastAPI** 知道该怎么处理。
    
    /// note | 注意
    
    如果不了解异步,请参阅文档中关于 `async` 和 `await` 的章节:[异步:*“着急了?”*](../../async.md#in-a-hurry)。
    
    ///
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri Mar 20 17:06:37 GMT 2026
    - 8.7K bytes
    - Click Count (0)
Back to Top