Retrofit with okhttp

封装接口

首先,我们将将请求api封装成一个接口(interface), Retrofit 通过这个定义的interface生成一个具体的实现。
interface中进行接口api的定义,比如

1
2
3
4
    public interface RepoService {
@GET("/users/{user}/repos")
Call<ResponseBody> listRepo(@Path("user") String user);
}
阅读更多