Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for hello_page (0.17 sec)

  1. tests/test_router_redirect_slashes.py

    from fastapi import APIRouter, FastAPI
    from fastapi.testclient import TestClient
    
    
    def test_redirect_slashes_enabled():
        app = FastAPI()
        router = APIRouter()
    
        @router.get("/hello/")
        def hello_page() -> str:
            return "Hello, World!"
    
        app.include_router(router)
    
        client = TestClient(app)
    
        response = client.get("/hello/", follow_redirects=False)
        assert response.status_code == 200
    
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Jun 22 10:37:50 GMT 2023
    - 974 bytes
    - Viewed (0)
Back to top