- Sort Score
- Result 10 results
- Languages All
Results 1151 - 1160 of 1,962 for fastapi (0.1 sec)
-
docs/nl/docs/python-types.md
/// ## Type hints in **FastAPI** **FastAPI** maakt gebruik van type hints om verschillende dingen te doen. Met **FastAPI** declareer je parameters met type hints en krijg je: * **Editor ondersteuning**. * **Type checks**. ...en **FastAPI** gebruikt dezelfde declaraties om:
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sun Oct 06 20:36:54 UTC 2024 - 18.3K bytes - Viewed (0) -
docs_src/security/tutorial002.py
from typing import Union from fastapi import Depends, FastAPI from fastapi.security import OAuth2PasswordBearer from pydantic import BaseModel app = FastAPI() oauth2_scheme = OAuth2PasswordBearer(tokenUrl="token") class User(BaseModel): username: str email: Union[str, None] = None full_name: Union[str, None] = None disabled: Union[bool, None] = None def fake_decode_token(token): return User(
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sat May 14 11:59:59 UTC 2022 - 755 bytes - Viewed (0) -
tests/test_serialize_response_model.py
from typing import Dict, List, Optional from fastapi import FastAPI from pydantic import BaseModel, Field from starlette.testclient import TestClient app = FastAPI() class Item(BaseModel): name: str = Field(alias="aliased_name") price: Optional[float] = None owner_ids: Optional[List[int]] = None @app.get("/items/valid", response_model=Item) def get_valid(): return Item(aliased_name="valid", price=1.0)
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Fri May 13 23:38:22 UTC 2022 - 4.2K bytes - Viewed (0) -
docs_src/security/tutorial002_an.py
from typing import Union from fastapi import Depends, FastAPI from fastapi.security import OAuth2PasswordBearer from pydantic import BaseModel from typing_extensions import Annotated app = FastAPI() oauth2_scheme = OAuth2PasswordBearer(tokenUrl="token") class User(BaseModel): username: str email: Union[str, None] = None full_name: Union[str, None] = None disabled: Union[bool, None] = None
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sat Mar 18 12:29:59 UTC 2023 - 815 bytes - Viewed (0) -
docs_src/security/tutorial007_an_py39.py
import secrets from typing import Annotated from fastapi import Depends, FastAPI, HTTPException, status from fastapi.security import HTTPBasic, HTTPBasicCredentials app = FastAPI() security = HTTPBasic() def get_current_username( credentials: Annotated[HTTPBasicCredentials, Depends(security)], ): current_username_bytes = credentials.username.encode("utf8") correct_username_bytes = b"stanleyjobson"
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Tue Mar 26 16:56:53 UTC 2024 - 1.1K bytes - Viewed (0) -
docs/zh/docs/advanced/index.md
# 高级用户指南 ## 额外特性 主要的教程 [教程 - 用户指南](../tutorial/index.md){.internal-link target=_blank} 应该足以让你了解 **FastAPI** 的所有主要特性。 你会在接下来的章节中了解到其他的选项、配置以及额外的特性。 /// tip 接下来的章节**并不一定是**「高级的」。 而且对于你的使用场景来说,解决方案很可能就在其中。 /// ## 先阅读教程 你可能仍会用到 **FastAPI** 主教程 [教程 - 用户指南](../tutorial/index.md){.internal-link target=_blank} 中的大多数特性。
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Tue Aug 06 04:48:30 UTC 2024 - 770 bytes - Viewed (0) -
tests/test_tutorial/test_query_params_str_validations/test_tutorial014_an.py
from fastapi.testclient import TestClient from docs_src.query_params_str_validations.tutorial014_an import app client = TestClient(app) def test_hidden_query(): response = client.get("/items?hidden_query=somevalue") assert response.status_code == 200, response.text assert response.json() == {"hidden_query": "somevalue"} def test_no_hidden_query(): response = client.get("/items")
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Fri Jun 30 18:25:16 UTC 2023 - 2.9K bytes - Viewed (0) -
docs/en/docs/tutorial/security/simple-oauth2.md
`OAuth2PasswordBearer` makes **FastAPI** know that it is a security scheme. So it is added that way to OpenAPI. But `OAuth2PasswordRequestForm` is just a class dependency that you could have written yourself, or you could have declared `Form` parameters directly. But as it's a common use case, it is provided by **FastAPI** directly, just to make it easier. ///
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sun Oct 06 20:36:54 UTC 2024 - 12.3K bytes - Viewed (0) -
docs/zh/docs/tutorial/dependencies/sub-dependencies.md
# 子依赖项 FastAPI 支持创建含**子依赖项**的依赖项。 并且,可以按需声明任意**深度**的子依赖项嵌套层级。 **FastAPI** 负责处理解析不同深度的子依赖项。 ### 第一层依赖项 下列代码创建了第一层依赖项: ```Python hl_lines="8-9" {!../../docs_src/dependencies/tutorial005.py!} ``` 这段代码声明了类型为 `str` 的可选查询参数 `q`,然后返回这个查询参数。 这个函数很简单(不过也没什么用),但却有助于让我们专注于了解子依赖项的工作方式。 ### 第二层依赖项 接下来,创建另一个依赖项函数,并同时用该依赖项自身再声明一个依赖项(所以这也是一个「依赖项」): ```Python hl_lines="13"
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sun Oct 06 20:36:54 UTC 2024 - 3.2K bytes - Viewed (0) -
docs/pt/docs/tutorial/path-operation-configuration.md
//// Esse código de status será usado na resposta e será adicionado ao esquema OpenAPI. /// note | "Detalhes Técnicos" Você também poderia usar `from starlette import status`. **FastAPI** fornece o mesmo `starlette.status` como `fastapi.status` apenas como uma conveniência para você, o desenvolvedor. Mas vem diretamente do Starlette. /// ## Tags
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sun Oct 06 20:36:54 UTC 2024 - 5.9K bytes - Viewed (0)