- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 22 for me (0.12 sec)
-
tests/test_tutorial/test_bigger_applications/test_main_an.py
}, ] } ) def test_users_me_token_jessica(client: TestClient): response = client.get("/users/me?token=jessica") assert response.status_code == 200 assert response.json() == {"username": "fakecurrentuser"} def test_users_me_with_no_token(client: TestClient): response = client.get("/users/me") assert response.status_code == 422 assert response.json() == IsDict(
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Thu Apr 18 19:40:57 GMT 2024 - 24.6K bytes - Viewed (0) -
tests/test_tutorial/test_bigger_applications/test_main_an_py39.py
] } ) @needs_py39 def test_users_me_token_jessica(client: TestClient): response = client.get("/users/me?token=jessica") assert response.status_code == 200 assert response.json() == {"username": "fakecurrentuser"} @needs_py39 def test_users_me_with_no_token(client: TestClient): response = client.get("/users/me") assert response.status_code == 422
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Thu Apr 18 19:40:57 GMT 2024 - 24.9K bytes - Viewed (0) -
docs/fr/docs/tutorial/path-params.md
Tel que `/users/me`, disons pour récupérer les données sur l'utilisateur actuel. Et vous avez un second chemin : `/users/{user_id}` pour récupérer de la donnée sur un utilisateur spécifique grâce à son identifiant d'utilisateur Les *fonctions de chemin* étant évaluées dans l'ordre, il faut s'assurer que la fonction correspondant à `/users/me` est déclarée avant celle de `/users/{user_id}` :
Plain Text - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Thu Apr 18 19:53:19 GMT 2024 - 10K bytes - Viewed (0) -
fastapi/security/http.py
from fastapi import Depends, FastAPI from fastapi.security import HTTPBasic, HTTPBasicCredentials app = FastAPI() security = HTTPBasic() @app.get("/users/me") def read_current_user(credentials: Annotated[HTTPBasicCredentials, Depends(security)]): return {"username": credentials.username, "password": credentials.password} ``` """ def __init__(
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Fri Apr 19 15:29:38 GMT 2024 - 13.2K bytes - Viewed (0) -
tests/test_security_oauth2_optional.py
return form_data @app.get("/users/me") def read_users_me(current_user: Optional[User] = Depends(get_current_user)): if current_user is None: return {"msg": "Create an account first"} return current_user client = TestClient(app) def test_security_oauth2(): response = client.get("/users/me", headers={"Authorization": "Bearer footokenbar"})
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Thu Apr 18 19:40:57 GMT 2024 - 10.8K bytes - Viewed (0) -
docs/zh/docs/tutorial/security/simple-oauth2.md
密码:`secret` <img src="https://fastapi.tiangolo.com/img/tutorial/security/image04.png"> 通过身份验证后,显示下图所示的内容: <img src="https://fastapi.tiangolo.com/img/tutorial/security/image05.png"> ### 获取当前用户数据 使用 `/users/me` 路径的 `GET` 操作。 可以提取如下当前用户数据: ```JSON { "username": "johndoe", "email": "******@****.***", "full_name": "John Doe", "disabled": false, "hashed_password": "fakehashedsecret" }
Plain Text - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Thu Apr 18 19:53:19 GMT 2024 - 8.8K bytes - Viewed (0) -
docs/em/docs/tutorial/security/simple-oauth2.md
🔐: `secret` <img src="/img/tutorial/security/image04.png"> ⏮️ 🔗 ⚙️, 👆 🔜 👀 ⚫️ 💖: <img src="/img/tutorial/security/image05.png"> ### 🤚 👆 👍 👩💻 💽 🔜 ⚙️ 🛠️ `GET` ⏮️ ➡ `/users/me`. 👆 🔜 🤚 👆 👩💻 📊, 💖: ```JSON { "username": "johndoe", "email": "******@****.***", "full_name": "John Doe", "disabled": false, "hashed_password": "fakehashedsecret" }
Plain Text - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Thu Apr 18 19:53:19 GMT 2024 - 8.9K bytes - Viewed (0) -
fastapi/param_functions.py
from typing import Annotated from fastapi import Depends, FastAPI from .db import User from .security import get_current_active_user app = FastAPI() @app.get("/users/me/items/") async def read_own_items( current_user: Annotated[User, Security(get_current_active_user, scopes=["items"])] ): return [{"item_id": "Foo", "owner": current_user.username}] ```
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Thu Apr 18 19:40:57 GMT 2024 - 62.5K bytes - Viewed (0) -
docs/en/docs/help-fastapi.md
You can connect with <a href="https://tiangolo.com" class="external-link" target="_blank">me (Sebastián Ramírez / `tiangolo`)</a>, the author. You can: * <a href="https://github.com/tiangolo" class="external-link" target="_blank">Follow me on **GitHub**</a>. * See other Open Source projects I have created that could help you. * Follow me to see when I create a new Open Source project.
Plain Text - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Thu Apr 18 19:53:19 GMT 2024 - 13.7K bytes - Viewed (0) -
tests/test_security_oauth2.py
return form_data @app.get("/users/me") # Here we use string annotations to test them def read_current_user(current_user: "User" = Depends(get_current_user)): return current_user client = TestClient(app) def test_security_oauth2(): response = client.get("/users/me", headers={"Authorization": "Bearer footokenbar"}) assert response.status_code == 200, response.text
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Thu Apr 18 19:40:57 GMT 2024 - 10.7K bytes - Viewed (0)