Я получаю вышеуказанную ошибку, вызывая остальные api. Я использую как retrofit2, так и RxJava.
ServiceFactory.java
public class ServiceFactory {
public static <T> T createRetrofitService(final Class<T> clazz, final String endpoint){
Retrofit retrofit = new Retrofit.Builder()
.baseUrl(endpoint)
//.addConverterFactory(GsonConverterFactory.create())
.build();
T service = retrofit.create(clazz);
return service;
}
}
MovieService.java
public interface MovieService{
//public final String API_KEY = "<apikey>";
public final String SERVICE_END = "https://api.mymovies.org/3/";
@GET("movie/{movieId}??api_key=xyz")
Observable<Response<Movies>> getMovies(@Field("movieId") int movieId);
}
Внутри MainActivity
MovieService tmdbService = ServiceFactory.createRetrofitService(MovieService.class, MovieService.SERVICE_END);
Observable<Response<Movies>> responseObservable = tmdbService.getMovies(400);
responseObservable .subscribeOn(Schedulers.newThread())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Subscriber<Response<Movies>>() {
@Override
public void onCompleted() {
}
@Override
public void onError(Throwable e) {
}
@Override
public void onNext(Response<Movies> moviesResponse) {
}
});