async def fetch_json(url: str) -> dict:
async with httpx.AsyncClient() as client:
response = await client.get(url)
if response.status_code == 200:
return response.json()
else:
raise HTTPException(
status_code=response.status_code, detail="Resource not found at URL: " + url
)
See how it is used in get_locations