FastAPI로 개발을 해도, 외부의 다른 API를 요청 할 때가 많다. 그럴 땐 httpx를 이용해 아래와 같이 구현 하면 된다.
httpx
import httpx async def call_other_api(...): async with httpx.AsyncClient() as client: .... # response = client.get(...) # response = client.post(...) return repsonse return response