Search Options

Results per page
Sort
Preferred Languages
Advance

Results 241 - 250 of 1,976 for Fastapi (0.08 sec)

  1. docs/em/docs/tutorial/security/first-steps.md

    👉 🔗 🔜 🚚 `str` 👈 🛠️ 🔢 `token` *➡ 🛠️ 🔢*.
    
    **FastAPI** 🔜 💭 👈 ⚫️ 💪 ⚙️ 👉 🔗 🔬 "💂‍♂ ⚖" 🗄 🔗 (& 🏧 🛠️ 🩺).
    
    /// info | "📡 ℹ"
    
    **FastAPI** 🔜 💭 👈 ⚫️ 💪 ⚙️ 🎓 `OAuth2PasswordBearer` (📣 🔗) 🔬 💂‍♂ ⚖ 🗄 ↩️ ⚫️ 😖 ⚪️➡️ `fastapi.security.oauth2.OAuth2`, ❔ 🔄 😖 ⚪️➡️ `fastapi.security.base.SecurityBase`.
    
    🌐 💂‍♂ 🚙 👈 🛠️ ⏮️ 🗄 (& 🏧 🛠️ 🩺) 😖 ⚪️➡️ `SecurityBase`, 👈 ❔ **FastAPI** 💪 💭 ❔ 🛠️ 👫 🗄.
    
    ///
    
    ## ⚫️❔ ⚫️ 🔨
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 6.8K bytes
    - Viewed (0)
  2. docs/zh/docs/tutorial/testing.md

    你也可以用 `from starlette.testclient import TestClient`。
    
    **FastAPI** 提供了和 `starlette.testclient` 一样的 `fastapi.testclient`,只是为了方便开发者。但它直接来自Starlette。
    
    ///
    
    /// tip | "提示"
    
    除了发送请求之外,如果你还想测试时在FastAPI应用中调用 `async` 函数(例如异步数据库函数), 可以在高级教程中看下 [Async Tests](../advanced/async-tests.md){.internal-link target=_blank} 。
    
    ///
    
    ## 分离测试
    
    在实际应用中,你可能会把你的测试放在另一个文件里。
    
    您的**FastAPI**应用程序也可能由一些文件/模块组成等等。
    
    ### **FastAPI** app 文件
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 6K bytes
    - Viewed (0)
  3. docs_src/request_files/tutorial002_an.py

    from typing import List
    
    from fastapi import FastAPI, File, UploadFile
    from fastapi.responses import HTMLResponse
    from typing_extensions import Annotated
    
    app = FastAPI()
    
    
    @app.post("/files/")
    async def create_files(files: Annotated[List[bytes], File()]):
        return {"file_sizes": [len(file) for file in files]}
    
    
    @app.post("/uploadfiles/")
    async def create_upload_files(files: List[UploadFile]):
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sat Mar 18 12:29:59 UTC 2023
    - 861 bytes
    - Viewed (0)
  4. docs_src/schema_extra_example/tutorial005_py310.py

    from fastapi import Body, FastAPI
    from pydantic import BaseModel
    
    app = FastAPI()
    
    
    class Item(BaseModel):
        name: str
        description: str | None = None
        price: float
        tax: float | None = None
    
    
    @app.put("/items/{item_id}")
    async def update_item(
        *,
        item_id: int,
        item: Item = Body(
            openapi_examples={
                "normal": {
                    "summary": "A normal example",
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sat Aug 26 18:03:13 UTC 2023
    - 1.3K bytes
    - Viewed (0)
  5. docs/pt/docs/advanced/index.md

    um curso avançado-iniciante para complementar essa seção da documentação, você pode querer conferir: <a href="https://testdriven.io/courses/tdd-fastapi/" class="external-link" target="_blank">Test-Driven Development com FastAPI e Docker</a> por **TestDriven.io**.
    
    Eles estão atualmente doando 10% de todos os lucros para o desenvolvimento do **FastAPI**. 🎉 😄...
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Tue Aug 06 04:48:30 UTC 2024
    - 1.2K bytes
    - Viewed (0)
  6. tests/test_forms_single_param.py

    from fastapi import FastAPI, Form
    from fastapi.testclient import TestClient
    from typing_extensions import Annotated
    
    app = FastAPI()
    
    
    @app.post("/form/")
    def post_form(username: Annotated[str, Form()]):
        return username
    
    
    client = TestClient(app)
    
    
    def test_single_form_field():
        response = client.post("/form/", data={"username": "Rick"})
        assert response.status_code == 200, response.text
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Thu Sep 05 11:24:36 UTC 2024
    - 3.5K bytes
    - Viewed (0)
  7. tests/test_reponse_set_reponse_code_empty.py

    from typing import Any
    
    from fastapi import FastAPI, Response
    from fastapi.testclient import TestClient
    
    app = FastAPI()
    
    
    @app.delete(
        "/{id}",
        status_code=204,
        response_model=None,
    )
    async def delete_deployment(
        id: int,
        response: Response,
    ) -> Any:
        response.status_code = 400
        return {"msg": "Status overwritten", "id": id}
    
    
    client = TestClient(app)
    
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri Jun 30 18:25:16 UTC 2023
    - 3.1K bytes
    - Viewed (0)
  8. tests/test_datastructures.py

    import io
    from pathlib import Path
    from typing import List
    
    import pytest
    from fastapi import FastAPI, UploadFile
    from fastapi.datastructures import Default
    from fastapi.testclient import TestClient
    
    
    # TODO: remove when deprecating Pydantic v1
    def test_upload_file_invalid():
        with pytest.raises(ValueError):
            UploadFile.validate("not a Starlette UploadFile")
    
    
    def test_upload_file_invalid_pydantic_v2():
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Wed Oct 18 12:36:40 UTC 2023
    - 2K bytes
    - Viewed (0)
  9. tests/test_read_with_orm_mode.py

    from typing import Any
    
    from fastapi import FastAPI
    from fastapi.testclient import TestClient
    from pydantic import BaseModel, ConfigDict
    
    from .utils import needs_pydanticv1, needs_pydanticv2
    
    
    @needs_pydanticv2
    def test_read_with_orm_mode() -> None:
        class PersonBase(BaseModel):
            name: str
            lastname: str
    
        class Person(PersonBase):
            @property
            def full_name(self) -> str:
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri Jul 07 17:12:13 UTC 2023
    - 2.4K bytes
    - Viewed (0)
  10. .github/ISSUE_TEMPLATE/config.yml

        url: https://github.com/fastapi/fastapi/discussions/categories/questions
      - name: Feature Request
        about: To suggest an idea or ask about a feature, please start with a question saying what you would like to achieve. There might be a way to do it already.
        url: https://github.com/fastapi/fastapi/discussions/categories/questions
      - name: Show and tell
        about: Show what you built with FastAPI or to be used with FastAPI.
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Mon Jul 29 23:35:07 UTC 2024
    - 926 bytes
    - Viewed (0)
Back to top