Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1581 - 1590 of 2,000 for Fastapi (0.08 sec)

  1. tests/test_tutorial/test_security/test_tutorial001_an.py

    from fastapi.testclient import TestClient
    
    from docs_src.security.tutorial001_an import app
    
    client = TestClient(app)
    
    
    def test_no_token():
        response = client.get("/items")
        assert response.status_code == 401, response.text
        assert response.json() == {"detail": "Not authenticated"}
        assert response.headers["WWW-Authenticate"] == "Bearer"
    
    
    def test_token():
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri Jun 30 18:25:16 UTC 2023
    - 1.9K bytes
    - Viewed (0)
  2. tests/test_tutorial/test_wsgi/test_tutorial001.py

    from fastapi.testclient import TestClient
    
    from docs_src.wsgi.tutorial001 import app
    
    client = TestClient(app)
    
    
    def test_flask():
        response = client.get("/v1/")
        assert response.status_code == 200, response.text
        assert response.text == "Hello, World from Flask!"
    
    
    def test_app():
        response = client.get("/v2")
        assert response.status_code == 200, response.text
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Thu Jul 09 18:06:12 UTC 2020
    - 436 bytes
    - Viewed (0)
  3. .github/workflows/add-to-project.yml

          - reopened
    
    jobs:
      add-to-project:
        name: Add to project
        runs-on: ubuntu-latest
        steps:
          - uses: actions/add-to-project@v1.0.2
            with:
              project-url: https://github.com/orgs/fastapi/projects/2
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Tue Aug 13 02:00:25 UTC 2024
    - 368 bytes
    - Viewed (0)
  4. docs_src/dependencies/tutorial008.py

    from fastapi import Depends
    
    
    async def dependency_a():
        dep_a = generate_dep_a()
        try:
            yield dep_a
        finally:
            dep_a.close()
    
    
    async def dependency_b(dep_a=Depends(dependency_a)):
        dep_b = generate_dep_b()
        try:
            yield dep_b
        finally:
            dep_b.close(dep_a)
    
    
    async def dependency_c(dep_b=Depends(dependency_b)):
        dep_c = generate_dep_c()
        try:
            yield dep_c
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Thu Mar 26 19:09:53 UTC 2020
    - 455 bytes
    - Viewed (0)
  5. docs_src/dependencies/tutorial009.py

    from fastapi import Depends
    
    
    async def dependency_a():
        dep_a = generate_dep_a()
        try:
            yield dep_a
        finally:
            dep_a.close()
    
    
    async def dependency_b(dep_a=Depends(dependency_a)):
        dep_b = generate_dep_b()
        try:
            yield dep_b
        finally:
            dep_b.close(dep_a)
    
    
    async def dependency_c(dep_b=Depends(dependency_b)):
        dep_c = generate_dep_c()
        try:
            yield dep_c
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Thu Mar 26 19:09:53 UTC 2020
    - 455 bytes
    - Viewed (0)
  6. docs_src/bigger_applications/app_an/routers/users.py

    from fastapi import APIRouter
    
    router = APIRouter()
    
    
    @router.get("/users/", tags=["users"])
    async def read_users():
        return [{"username": "Rick"}, {"username": "Morty"}]
    
    
    @router.get("/users/me", tags=["users"])
    async def read_user_me():
        return {"username": "fakecurrentuser"}
    
    
    @router.get("/users/{username}", tags=["users"])
    async def read_user(username: str):
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sat Mar 18 12:29:59 UTC 2023
    - 407 bytes
    - Viewed (0)
  7. docs/em/docs/tutorial/middleware.md

    # ๐Ÿ› ๏ธ
    
    ๐Ÿ‘† ๐Ÿ’ช ๐Ÿšฎ ๐Ÿ› ๏ธ **FastAPI** ๐Ÿˆธ.
    
    "๐Ÿ› ๏ธ" ๐Ÿ”ข ๐Ÿ‘ˆ ๐Ÿ‘ท โฎ๏ธ ๐Ÿ”  **๐Ÿ“จ** โญ โšซ๏ธ ๐Ÿ› ๏ธ ๐Ÿ™† ๐ŸŽฏ *โžก ๐Ÿ› ๏ธ*. & โฎ๏ธ ๐Ÿ”  **๐Ÿ“จ** โญ ๐Ÿ›ฌ โšซ๏ธ.
    
    * โšซ๏ธ โœŠ ๐Ÿ”  **๐Ÿ“จ** ๐Ÿ‘ˆ ๐Ÿ‘Ÿ ๐Ÿ‘† ๐Ÿˆธ.
    * โšซ๏ธ ๐Ÿ’ช โคด๏ธ ๐Ÿ•ณ ๐Ÿ‘ˆ **๐Ÿ“จ** โš–๏ธ ๐Ÿƒ ๐Ÿ™† ๐Ÿ’ช ๐Ÿ“Ÿ.
    * โคด๏ธ โšซ๏ธ ๐Ÿšถโ€โ™€๏ธ **๐Ÿ“จ** ๐Ÿ› ๏ธ ๐ŸŽ‚ ๐Ÿˆธ ( *โžก ๐Ÿ› ๏ธ*).
    * โšซ๏ธ โคด๏ธ โœŠ **๐Ÿ“จ** ๐Ÿ— ๐Ÿˆธ ( *โžก ๐Ÿ› ๏ธ*).
    * โšซ๏ธ ๐Ÿ’ช ๐Ÿ•ณ ๐Ÿ‘ˆ **๐Ÿ“จ** โš–๏ธ ๐Ÿƒ ๐Ÿ™† ๐Ÿ’ช ๐Ÿ“Ÿ.
    * โคด๏ธ โšซ๏ธ ๐Ÿ“จ **๐Ÿ“จ**.
    
    /// note | "๐Ÿ“ก โ„น"
    
    ๐Ÿšฅ ๐Ÿ‘† โœ”๏ธ ๐Ÿ”— โฎ๏ธ `yield`, ๐Ÿšช ๐Ÿ“Ÿ ๐Ÿ”œ ๐Ÿƒ *โฎ๏ธ* ๐Ÿ› ๏ธ.
    
    ๐Ÿšฅ ๐Ÿ“ค ๐Ÿ™† ๐Ÿ–ฅ ๐Ÿ“‹ (๐Ÿ“„ โช), ๐Ÿ‘ซ ๐Ÿ”œ ๐Ÿƒ *โฎ๏ธ* ๐ŸŒ ๐Ÿ› ๏ธ.
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 2.4K bytes
    - Viewed (0)
  8. tests/test_tutorial/test_request_form_models/test_tutorial002.py

    import pytest
    from fastapi.testclient import TestClient
    
    from tests.utils import needs_pydanticv2
    
    
    @pytest.fixture(name="client")
    def get_client():
        from docs_src.request_form_models.tutorial002 import app
    
        client = TestClient(app)
        return client
    
    
    @needs_pydanticv2
    def test_post_body_form(client: TestClient):
        response = client.post("/login/", data={"username": "Foo", "password": "secret"})
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri Sep 06 17:31:18 UTC 2024
    - 6.2K bytes
    - Viewed (0)
  9. tests/test_tutorial/test_query_params/test_tutorial006_py310.py

    import pytest
    from dirty_equals import IsDict
    from fastapi.testclient import TestClient
    
    from ...utils import needs_py310
    
    
    @pytest.fixture(name="client")
    def get_client():
        from docs_src.query_params.tutorial006_py310 import app
    
        c = TestClient(app)
        return c
    
    
    @needs_py310
    def test_foo_needy_very(client: TestClient):
        response = client.get("/items/foo?needy=very")
        assert response.status_code == 200
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Thu Apr 18 19:40:57 UTC 2024
    - 6.2K bytes
    - Viewed (0)
  10. tests/test_tutorial/test_query_params_str_validations/test_tutorial010.py

    import pytest
    from dirty_equals import IsDict
    from fastapi.testclient import TestClient
    
    
    @pytest.fixture(name="client")
    def get_client():
        from docs_src.query_params_str_validations.tutorial010 import app
    
        client = TestClient(app)
        return client
    
    
    def test_query_params_str_validations_no_query(client: TestClient):
        response = client.get("/items/")
        assert response.status_code == 200
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Thu Apr 18 19:40:57 UTC 2024
    - 6.2K bytes
    - Viewed (0)
Back to top