Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 218 for www (0.14 sec)

  1. tests/test_tutorial/test_security/test_tutorial005_an.py

        assert response.headers["WWW-Authenticate"] == 'Bearer scope="me"'
    
    
    def test_incorrect_token_type():
        response = client.get(
            "/users/me", headers={"Authorization": "Notexistent testtoken"}
        )
        assert response.status_code == 401, response.text
        assert response.json() == {"detail": "Not authenticated"}
        assert response.headers["WWW-Authenticate"] == "Bearer"
    
    
    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/en/docs/tutorial/testing.md

    # Testing
    
    Thanks to <a href="https://www.starlette.io/testclient/" class="external-link" target="_blank">Starlette</a>, testing **FastAPI** applications is easy and enjoyable.
    
    It is based on <a href="https://www.python-httpx.org" class="external-link" target="_blank">HTTPX</a>, which in turn is designed based on Requests, so it's very familiar and intuitive.
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 6.2K bytes
    - Viewed (0)
  3. docs/zh/docs/advanced/using-request-directly.md

    * 等
    
    **FastAPI** 使用这种方式验证数据、转换数据,并自动生成 API 文档。
    
    但有时,我们也需要直接访问 `Request` 对象。
    
    ## `Request` 对象的细节
    
    实际上,**FastAPI** 的底层是 **Starlette**,**FastAPI** 只不过是在  **Starlette** 顶层提供了一些工具,所以能直接使用 Starlette 的  <a href="https://www.starlette.io/requests/" class="external-link" target="_blank">`Request`</a> 对象。
    
    但直接从 `Request` 对象提取数据时(例如,读取请求体),**FastAPI** 不会验证、转换和存档数据(为 API 文档使用 OpenAPI)。
    
    不过,仍可以验证、转换与注释(使用 Pydantic 模型的请求体等)其它正常声明的参数。
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat Mar 30 22:44:02 GMT 2024
    - 2K bytes
    - Viewed (0)
  4. docs/de/docs/advanced/openapi-callbacks.md

    ```
    https://yourapi.com/invoices/?callback_url=https://www.external.org/events
    ```
    
    mit einem JSON-Körper:
    
    ```JSON
    {
        "id": "2expen51ve",
        "customer": "Mr. Richie Rich",
        "total": "9999"
    }
    ```
    
    dann verarbeitet *Ihre API* die Rechnung und sendet irgendwann später einen Callback-Request an die `callback_url` (die *externe API*):
    
    ```
    https://www.external.org/events/invoices/2expen51ve
    ```
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat Mar 30 20:17:23 GMT 2024
    - 8.8K bytes
    - Viewed (0)
  5. docs_src/security/tutorial004.py

    async def get_current_user(token: str = Depends(oauth2_scheme)):
        credentials_exception = HTTPException(
            status_code=status.HTTP_401_UNAUTHORIZED,
            detail="Could not validate credentials",
            headers={"WWW-Authenticate": "Bearer"},
        )
        try:
            payload = jwt.decode(token, SECRET_KEY, algorithms=[ALGORITHM])
            username: str = payload.get("sub")
            if username is None:
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Tue Mar 26 16:56:53 GMT 2024
    - 4K bytes
    - Viewed (0)
  6. docs_src/security/tutorial004_an.py

    async def get_current_user(token: Annotated[str, Depends(oauth2_scheme)]):
        credentials_exception = HTTPException(
            status_code=status.HTTP_401_UNAUTHORIZED,
            detail="Could not validate credentials",
            headers={"WWW-Authenticate": "Bearer"},
        )
        try:
            payload = jwt.decode(token, SECRET_KEY, algorithms=[ALGORITHM])
            username: str = payload.get("sub")
            if username is None:
    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)
  7. docs/em/docs/advanced/openapi-callbacks.md

    ```
    https://yourapi.com/invoices/?callback_url=https://www.external.org/events
    ```
    
    ⏮️ 🎻 💪:
    
    ```JSON
    {
        "id": "2expen51ve",
        "customer": "Mr. Richie Rich",
        "total": "9999"
    }
    ```
    
    ⤴️ *👆 🛠️* 🔜 🛠️ 🧾, &amp; ☝ ⏪, 📨 ⏲ 📨 `callback_url` ( *🔢 🛠️*):
    
    ```
    https://www.external.org/events/invoices/2expen51ve
    ```
    
    ⏮️ 🎻 💪 ⚗ 🕳 💖:
    
    ```JSON
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Mar 22 01:42:11 GMT 2024
    - 6.6K bytes
    - Viewed (0)
  8. docs/fr/docs/history-design-future.md

    J'ai testé plusieurs idées dans les éditeurs Python les plus populaires : PyCharm, VS Code, les éditeurs basés sur Jedi.
    
    D'après la dernière <a href="https://www.jetbrains.com/research/python-developers-survey-2018/#development-tools" class="external-link" target="_blank">Enquête Développeurs Python</a>, cela couvre environ 80% des utilisateurs.
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Mar 22 01:42:11 GMT 2024
    - 4.9K bytes
    - Viewed (0)
  9. docs_src/security/tutorial007_an.py

        )
        if not (is_correct_username and is_correct_password):
            raise HTTPException(
                status_code=status.HTTP_401_UNAUTHORIZED,
                detail="Incorrect username or password",
                headers={"WWW-Authenticate": "Basic"},
            )
        return credentials.username
    
    
    @app.get("/users/me")
    def read_current_user(username: Annotated[str, Depends(get_current_username)]):
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Tue Mar 26 16:56:53 GMT 2024
    - 1.2K bytes
    - Viewed (0)
  10. docs/ja/docs/tutorial/request-forms.md

    ## 「フォームフィールド」について
    
    HTMLフォーム(`<form></form>`)がサーバにデータを送信する方法は、通常、そのデータに「特別な」エンコーディングを使用していますが、これはJSONとは異なります。
    
    **FastAPI** は、JSONの代わりにそのデータを適切な場所から読み込むようにします。
    
    !!! note "技術詳細"
        フォームからのデータは通常、`application/x-www-form-urlencoded`の「media type」を使用してエンコードされます。
    
        しかし、フォームがファイルを含む場合は、`multipart/form-data`としてエンコードされます。ファイルの扱いについては次の章で説明します。
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Wed Mar 13 19:02:19 GMT 2024
    - 3.3K bytes
    - Viewed (0)
Back to top