Replace `requests` with `httpx` in SMS service
Problem
app/services/sms_service.py uses the synchronous requests library to call the Fast2SMS API. In an async FastAPI application this blocks the event loop for the duration of the HTTP call, degrading throughput under load.
Location
app/services/sms_service.py
Fix
Replace with httpx (BSD-3, async-native, already the standard in FastAPI projects):
import httpx
async def send_otp_sms(phone: str, otp: str):
async with httpx.AsyncClient() as client:
response = await client.post(FAST2SMS_URL, ...)
httpx supports retries via httpx-retries and has a nearly identical API to requests.
References
Effort
Low (~1h)