Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 3 of 3 for sum (0.23 sec)

  1. docs_src/custom_request_and_route/tutorial001.py

                return await original_route_handler(request)
    
            return custom_route_handler
    
    
    app = FastAPI()
    app.router.route_class = GzipRoute
    
    
    @app.post("/sum")
    async def sum_numbers(numbers: List[int] = Body()):
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri May 13 23:38:22 GMT 2022
    - 973 bytes
    - Viewed (0)
  2. tests/test_tutorial/test_custom_request_and_route/test_tutorial001.py

        if compress:
            data = gzip.compress(data)
            headers["Content-Encoding"] = "gzip"
        headers["Content-Type"] = "application/json"
        response = client.post("/sum", content=data, headers=headers)
        assert response.json() == {"sum": n}
    
    
    def test_request_class():
        response = client.get("/check-class")
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sun Nov 13 14:26:09 GMT 2022
    - 886 bytes
    - Viewed (0)
  3. docs_src/custom_request_and_route/tutorial002.py

            return custom_route_handler
    
    
    app = FastAPI()
    app.router.route_class = ValidationErrorLoggingRoute
    
    
    @app.post("/")
    async def sum_numbers(numbers: List[int] = Body()):
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri May 13 23:38:22 GMT 2022
    - 932 bytes
    - Viewed (0)
Back to top