In accordance with the information from the official site, I added the last degree and began to develop.
First, I created a model with data that interests me:
public class Data{ String parametr1;
the second step was to add a service:
public interface GitHubService { @GET("/repos/{owner}/{repo}") Call<Data> repoInfos(@Path("user") String owner, @Path("repo") String repo); Retrofit retrofit = new Retrofit.Builder().baseUrl("https://api.github.com/").build(); }
Thirdly, you need to add an implementation:
@Service public class GitHubServiceImpl implements GitHubService { final GitHubService gitHubService = GitHubService.retrofit.create(GitHubService.class); @Override public Call<DetailDto> repoDetails(String owner, String repo) { return gitHubService.repoDetails(owner, repo); } }
But there is an error:
java.lang.IllegalArgumentException: Could not locate ResponseBody converter for class model.Data.
Here is a complete error log trace
source share