在实际项目中往往是使用Retrofit来做网络请求工作。Retrofit采用RESTful风格,本质上只是对OkHttp进行封装,今天我们根据几个问题来进一步学习一下Retrofit的源码与设计思想。 直接看一下官方介绍的使用方法。 public final class SimpleService { public static final String API_URL = "https://api.github.com"; public static class Contributor { public final String login; public final int contributions; public Contributor(String login, int contributions) { this.login = login; this.contributions = contributions; } } public interface GitHub { @GET("/repos/{owner}/{repo}/contributors")...
Is this you? As a journalist, you can create a free Muck Rack account to customize your profile, list your contact preferences, and upload a portfolio of your best work.
Claim your profile
Get in touch with HttpService
Contact HttpService, search articles and posts on X, monitor coverage, and track replies from one place.
Learn more about Muck Rack