Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 4 of 4 for add_api_route (0.31 sec)

  1. tests/main.py

    app = FastAPI()
    
    
    @app.api_route("/api_route")
    def non_operation():
        return {"message": "Hello World"}
    
    
    def non_decorated_route():
        return {"message": "Hello World"}
    
    
    app.add_api_route("/non_decorated_route", non_decorated_route)
    
    
    @app.get("/text")
    def get_text():
        return "Hello World"
    
    
    @app.get("/path/{item_id}")
    def get_id(item_id):
        return item_id
    
    
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 21:56:59 GMT 2024
    - 4.3K bytes
    - Viewed (0)
  2. tests/test_extra_routes.py

    
    @app.api_route("/items/{item_id}", methods=["GET"])
    def get_items(item_id: str):
        return {"item_id": item_id}
    
    
    def get_not_decorated(item_id: str):
        return {"item_id": item_id}
    
    
    app.add_api_route("/items-not-decorated/{item_id}", get_not_decorated)
    
    
    @app.delete("/items/{item_id}")
    def delete_item(item_id: str, item: Item):
        return {"item_id": item_id, "item": item}
    
    
    @app.head("/items/{item_id}")
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 13.7K bytes
    - Viewed (0)
  3. fastapi/routing.py

                    methods=methods,
                    name=name,
                    include_in_schema=include_in_schema,
                )
                return func
    
            return decorator
    
        def add_api_route(
            self,
            path: str,
            endpoint: Callable[..., Any],
            *,
            response_model: Any = Default(None),
            status_code: Optional[int] = None,
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Tue Apr 02 02:48:51 GMT 2024
    - 170.1K bytes
    - Viewed (0)
  4. fastapi/applications.py

            if self.root_path:
                scope["root_path"] = self.root_path
            await super().__call__(scope, receive, send)
    
        def add_api_route(
            self,
            path: str,
            endpoint: Callable[..., Coroutine[Any, Any, Response]],
            *,
            response_model: Any = Default(None),
            status_code: Optional[int] = None,
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Tue Apr 02 02:48:51 GMT 2024
    - 172.2K bytes
    - Viewed (0)
Back to top