Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 187 for get3 (0.02 sec)

  1. tests/test_application.py

        ],
    )
    def test_get_path(path, expected_status, expected_response):
        response = client.get(path)
        assert response.status_code == expected_status
        assert response.json() == expected_response
    
    
    def test_swagger_ui():
        response = client.get("/docs")
        assert response.status_code == 200, response.text
        assert response.headers["content-type"] == "text/html; charset=utf-8"
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 18:19:10 UTC 2025
    - 51.9K bytes
    - Viewed (0)
  2. tests/test_request_params/test_cookie/test_optional_str.py

    # =====================================================================================
    # Without aliases
    
    
    @app.get("/optional-str")
    async def read_optional_str(p: Annotated[Optional[str], Cookie()] = None):
        return {"p": p}
    
    
    class CookieModelOptionalStr(BaseModel):
        p: Optional[str] = None
    
    
    @app.get("/model-optional-str")
    async def read_model_optional_str(p: Annotated[CookieModelOptionalStr, Cookie()]):
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 18:19:10 UTC 2025
    - 8.4K bytes
    - Viewed (0)
  3. tests/test_request_params/test_header/test_optional_list.py

    # Without aliases
    
    
    @app.get("/optional-list-str")
    async def read_optional_list_str(
        p: Annotated[Optional[list[str]], Header()] = None,
    ):
        return {"p": p}
    
    
    class HeaderModelOptionalListStr(BaseModel):
        p: Optional[list[str]] = None
    
    
    @app.get("/model-optional-list-str")
    async def read_model_optional_list_str(
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 18:19:10 UTC 2025
    - 9.3K bytes
    - Viewed (0)
  4. tests/test_request_params/test_query/test_list.py

    # =====================================================================================
    # Without aliases
    
    
    @app.get("/required-list-str")
    async def read_required_list_str(p: Annotated[list[str], Query()]):
        return {"p": p}
    
    
    class QueryModelRequiredListStr(BaseModel):
        p: list[str]
    
    
    @app.get("/model-required-list-str")
    def read_model_required_list_str(p: Annotated[QueryModelRequiredListStr, Query()]):
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 18:31:34 UTC 2025
    - 10.9K bytes
    - Viewed (0)
  5. tests/test_response_model_as_return_annotation.py

        price: float
    
    
    app = FastAPI()
    
    
    @app.get("/no_response_model-no_annotation-return_model")
    def no_response_model_no_annotation_return_model():
        return User(name="John", surname="Doe")
    
    
    @app.get("/no_response_model-no_annotation-return_dict")
    def no_response_model_no_annotation_return_dict():
        return {"name": "John", "surname": "Doe"}
    
    
    @app.get("/response_model-no_annotation-return_same_model", response_model=User)
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 12:54:56 UTC 2025
    - 47.7K bytes
    - Viewed (0)
  6. tests/test_path.py

    
    def test_text_get():
        response = client.get("/text")
        assert response.status_code == 200, response.text
        assert response.json() == "Hello World"
    
    
    def test_nonexistent():
        response = client.get("/nonexistent")
        assert response.status_code == 404, response.text
        assert response.json() == {"detail": "Not Found"}
    
    
    def test_path_foobar():
        response = client.get("/path/foobar")
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 18:19:10 UTC 2025
    - 20.5K bytes
    - Viewed (1)
  7. tests/test_tutorial/test_metadata/test_tutorial003.py

    def test_swagger_ui_default_url():
        response = client.get("/docs")
        assert response.status_code == 404, response.text
    
    
    def test_swagger_ui_custom_url():
        response = client.get("/documentation")
        assert response.status_code == 200, response.text
        assert "<title>FastAPI - Swagger UI</title>" in response.text
    
    
    def test_redoc_ui_default_url():
        response = client.get("/redoc")
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Fri Dec 26 10:43:02 UTC 2025
    - 1.5K bytes
    - Viewed (0)
  8. tests/test_infer_param_optionality.py

    app = FastAPI()
    
    
    user_router = APIRouter()
    item_router = APIRouter()
    
    
    @user_router.get("/")
    def get_users():
        return [{"user_id": "u1"}, {"user_id": "u2"}]
    
    
    @user_router.get("/{user_id}")
    def get_user(user_id: str):
        return {"user_id": user_id}
    
    
    @item_router.get("/")
    def get_items(user_id: Optional[str] = None):
        if user_id is None:
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 18:19:10 UTC 2025
    - 12.1K bytes
    - Viewed (0)
  9. tests/test_request_params/test_query/test_optional_str.py

    # =====================================================================================
    # Without aliases
    
    
    @app.get("/optional-str")
    async def read_optional_str(p: Optional[str] = None):
        return {"p": p}
    
    
    class QueryModelOptionalStr(BaseModel):
        p: Optional[str] = None
    
    
    @app.get("/model-optional-str")
    async def read_model_optional_str(p: Annotated[QueryModelOptionalStr, Query()]):
        return {"p": p.p}
    
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 18:19:10 UTC 2025
    - 8.1K bytes
    - Viewed (0)
  10. tests/test_request_params/test_cookie/test_required_str.py

    # =====================================================================================
    # Without aliases
    
    
    @app.get("/required-str")
    async def read_required_str(p: Annotated[str, Cookie()]):
        return {"p": p}
    
    
    class CookieModelRequiredStr(BaseModel):
        p: str
    
    
    @app.get("/model-required-str")
    async def read_model_required_str(p: Annotated[CookieModelRequiredStr, Cookie()]):
        return {"p": p.p}
    
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 18:19:10 UTC 2025
    - 10.2K bytes
    - Viewed (0)
Back to top