Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 61 for me (0.33 sec)

  1. tests/test_tutorial/test_security/test_tutorial005_an.py

                                },
                            }
                        },
                        "summary": "Read Users Me",
                        "operationId": "read_users_me_users_me__get",
                        "security": [{"OAuth2PasswordBearer": ["me"]}],
                    }
                },
                "/users/me/items/": {
                    "get": {
                        "responses": {
                            "200": {
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Wed Mar 13 19:07:10 GMT 2024
    - 15.4K bytes
    - Viewed (0)
  2. docs_src/security/tutorial004.py

        )
        return Token(access_token=access_token, token_type="bearer")
    
    
    @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 = Depends(get_current_active_user)):
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Tue Mar 26 16:56:53 GMT 2024
    - 4K bytes
    - Viewed (0)
  3. docs_src/security/tutorial004_an.py

        )
        return Token(access_token=access_token, token_type="bearer")
    
    
    @app.get("/users/me/", response_model=User)
    async def read_users_me(
        current_user: Annotated[User, Depends(get_current_active_user)],
    ):
        return current_user
    
    
    @app.get("/users/me/items/")
    async def read_own_items(
        current_user: Annotated[User, Depends(get_current_active_user)],
    ):
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Tue Mar 26 16:56:53 GMT 2024
    - 4.1K bytes
    - Viewed (0)
  4. 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)
  5. 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)
  6. docs_src/security/tutorial003_an_py39.py

            raise HTTPException(status_code=400, detail="Incorrect username or password")
    
        return {"access_token": user.username, "token_type": "bearer"}
    
    
    @app.get("/users/me")
    async def read_users_me(
        current_user: Annotated[User, Depends(get_current_active_user)],
    ):
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Tue Mar 26 16:56:53 GMT 2024
    - 2.5K bytes
    - Viewed (0)
  7. docs/en/docs/tutorial/path-params.md

    When creating *path operations*, you can find situations where you have a fixed path.
    
    Like `/users/me`, let's say that it's to get data about the current user.
    
    And then you can also have a path `/users/{user_id}` to get data about a specific user by some user ID.
    
    Because *path operations* are evaluated in order, you need to make sure that the path for `/users/me` is declared before the one for `/users/{user_id}`:
    
    ```Python hl_lines="6  11"
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Mar 22 01:42:11 GMT 2024
    - 9.1K bytes
    - Viewed (0)
  8. docs/ru/docs/tutorial/path-params.md

    Например, `/users/me`. Предположим, что это путь для получения данных о текущем пользователе.
    
    У вас также может быть путь `/users/{user_id}`, чтобы получить данные о конкретном пользователе по его ID.
    
    Поскольку *операции пути* выполняются в порядке их объявления, необходимо, чтобы путь для `/users/me` был объявлен раньше, чем путь для `/users/{user_id}`:
    
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Mar 22 01:42:11 GMT 2024
    - 14.1K bytes
    - Viewed (0)
  9. docs/zh/docs/tutorial/path-params.md

    下一章介绍详细内容。
    
    ## 顺序很重要
    
    有时,*路径操作*中的路径是写死的。
    
    比如要使用 `/users/me` 获取当前用户的数据。
    
    然后还要使用 `/users/{user_id}`,通过用户 ID 获取指定用户的数据。
    
    由于*路径操作*是按顺序依次运行的,因此,一定要在 `/users/{user_id}` 之前声明 `/users/me` :
    
    ```Python hl_lines="6  11"
    {!../../../docs_src/path_params/tutorial003.py!}
    ```
    
    否则,`/users/{user_id}` 将匹配 `/users/me`,FastAPI 会**认为**正在接收值为 `"me"` 的 `user_id` 参数。
    
    ## 预设值
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Mon Apr 01 05:35:40 GMT 2024
    - 7.6K bytes
    - Viewed (0)
  10. 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)
Back to top