from fastapi import APIRouter, HTTPException users = [ { "id": "1", "username": "user1", "email": "user1@example.com", "country": "USA", "state": "California" }, { "id": "2", "username": "user2", "email": "user2@example.com", "country": "Canada", "state": "Ontario" } ] router = APIRouter() @router.get("/users") async def get_users(): """Fetch list of users""" if request.method != "GET": raise HTTPException(status_code=405, detail="Method Not Allowed") return { "method": "GET", "_verb": "get", "users": users } ``` This endpoint fetches a list of users from the in-memory `users` list. It checks if the request method is GET, and if not, raises a 405 Method Not Allowed error. The response includes the method, a "_verb" metadata field, and the list of user objects containing id, username, email, country, and state.