Retrofit là HTTP client type-safe chuyển REST API thành Kotlin interface.
- Bạn định nghĩa interface với method được annotate bằng HTTP verb như
@GET,@POST, thêm kiểu request/response, và Retrofit tự sinh implementation. - Nó tự động deserialize JSON response thành Kotlin object, xử lý header, và hỗ trợ cả callback lẫn coroutine.
- OkHttp là thư viện networking nền mà Retrofit dùng.