Search Options

Display Count
Sort
Preferred Language
Advanced Search

Results 201 - 210 of 795 for asyncId (0.06 seconds)

  1. docs/zh/docs/advanced/dataclasses.md

    7. 这里的 `response_model` 使用了 “`Author` 数据类列表” 的类型注解。
    
       同样,你可以将 `dataclasses` 与标准类型注解组合使用。
    8. 注意,这个 *路径操作函数* 使用的是常规的 `def` 而不是 `async def`。
    
       一如既往,在 FastAPI 中你可以按需组合 `def` 和 `async def`。
    
       如果需要回顾何时用哪一个,请查看关于 [`async` 和 `await`](../async.md#in-a-hurry) 的文档中的 _“急不可待?”_ 一节。
    9. 这个 *路径操作函数* 返回的不是数据类(当然也可以返回数据类),而是包含内部数据的字典列表。
    
       FastAPI 会使用(包含数据类的)`response_model` 参数来转换响应。
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri Mar 20 17:06:37 GMT 2026
    - 3.9K bytes
    - Click Count (0)
  2. tests/test_response_model_data_filter.py

        name: str
        owner: UserDB
    
    
    class PetOut(BaseModel):
        name: str
        owner: UserBase
    
    
    @app.post("/users/", response_model=UserBase)
    async def create_user(user: UserCreate):
        return user
    
    
    @app.get("/pets/{pet_id}", response_model=PetOut)
    async def read_pet(pet_id: int):
        user = UserDB(
            email="******@****.***",
            hashed_password="secrethashed",
        )
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Wed Dec 17 21:25:59 GMT 2025
    - 1.7K bytes
    - Click Count (0)
  3. tests/test_request_params/test_form/test_optional_list.py

    
    @app.post("/optional-list-str", operation_id="optional_list_str")
    async def read_optional_list_str(
        p: Annotated[list[str] | None, Form()] = None,
    ):
        return {"p": p}
    
    
    class FormModelOptionalListStr(BaseModel):
        p: list[str] | None = None
    
    
    @app.post("/model-optional-list-str", operation_id="model_optional_list_str")
    async def read_model_optional_list_str(p: Annotated[FormModelOptionalListStr, Form()]):
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Tue Feb 17 09:59:14 GMT 2026
    - 9.9K bytes
    - Click Count (0)
  4. docs_src/app_testing/tutorial002_py310.py

    from fastapi import FastAPI
    from fastapi.testclient import TestClient
    from fastapi.websockets import WebSocket
    
    app = FastAPI()
    
    
    @app.get("/")
    async def read_main():
        return {"msg": "Hello World"}
    
    
    @app.websocket("/ws")
    async def websocket(websocket: WebSocket):
        await websocket.accept()
        await websocket.send_json({"msg": "Hello WebSocket"})
        await websocket.close()
    
    
    def test_read_main():
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Feb 12 13:19:43 GMT 2026
    - 757 bytes
    - Click Count (0)
  5. tensorflow/c/eager/c_api_cluster_test.cc

      TFE_Execute(op, out_value, &num_retvals, status);
      ASSERT_EQ(TF_OK, TF_GetCode(status)) << TF_Message(status);
      TFE_DeleteOp(op);
      TF_DeleteStatus(status);
    }
    
    void TestRemoteExecuteChangeServerDef(bool async) {
      tensorflow::ServerDef server_def = GetServerDef(2);
    
      // This server def has the task index set to 0.
      string serialized = server_def.SerializeAsString();
    
      server_def.set_task_index(1);
    
    Created: Tue Apr 07 12:39:13 GMT 2026
    - Last Modified: Thu Oct 09 05:56:18 GMT 2025
    - 19.2K bytes
    - Click Count (0)
  6. docs/pt/docs/tutorial/dependencies/index.md

    ## `Async` ou não, eis a questão { #to-async-or-not-to-async }
    
    Como as dependências também serão chamadas pelo **FastAPI** (da mesma forma que *funções de operação de rota*), as mesmas regras se aplicam ao definir suas funções.
    
    Você pode utilizar `async def` ou apenas `def`.
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Mar 19 18:20:43 GMT 2026
    - 10.6K bytes
    - Click Count (0)
  7. docs_src/custom_request_and_route/tutorial002_an_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
    - 974 bytes
    - Click Count (0)
  8. fastapi/security/api_key.py

        ```python
        from fastapi import Depends, FastAPI
        from fastapi.security import APIKeyQuery
    
        app = FastAPI()
    
        query_scheme = APIKeyQuery(name="api_key")
    
    
        @app.get("/items/")
        async def read_items(api_key: str = Depends(query_scheme)):
            return {"api_key": api_key}
        ```
        """
    
        def __init__(
            self,
            *,
            name: Annotated[
                str,
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Sun Mar 15 11:44:39 GMT 2026
    - 9.6K bytes
    - Click Count (1)
  9. src/test/java/jcifs/internal/NotifyResponseTest.java

                return this.notifyInformation;
            }
    
            @Override
            public boolean isAsync() {
                return this.async;
            }
    
            public void setAsync(boolean async) {
                this.async = async;
            }
    
            @Override
            public CommonServerMessageBlockResponse getNextResponse() {
                return this.nextResponse;
            }
    
    Created: Sun Apr 05 00:10:12 GMT 2026
    - Last Modified: Thu Aug 14 05:31:44 GMT 2025
    - 21.2K bytes
    - Click Count (0)
  10. tests/test_request_params/test_form/test_optional_str.py

    # Without aliases
    
    
    @app.post("/optional-str", operation_id="optional_str")
    async def read_optional_str(p: Annotated[str | None, Form()] = None):
        return {"p": p}
    
    
    class FormModelOptionalStr(BaseModel):
        p: str | None = None
    
    
    @app.post("/model-optional-str", operation_id="model_optional_str")
    async def read_model_optional_str(p: Annotated[FormModelOptionalStr, Form()]):
        return {"p": p.p}
    
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Tue Feb 17 09:59:14 GMT 2026
    - 8.9K bytes
    - Click Count (0)
Back to Top