Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public interface Link {
- @GET("3/movie/315635?api_key=66d87776b3672f4b97c6e57ffe238776&language=en-US")
- Call<List<Model>> moviesList();
- }
- public class ApiClient {
- public static final String BASE_URL = "https://api.themoviedb.org/";
- public static Retrofit retrofit = null;
- public static Retrofit getApiClient() {
- if (retrofit == null) {
- retrofit = new Retrofit.Builder().baseUrl(BASE_URL).addConverterFactory(GsonConverterFactory.create()).build();
- }
- return retrofit;
- }
- }
- {
- "adult": false,
- "backdrop_path": "/fudEG1VUWuOqleXv6NwCExK0VLy.jpg",
- "belongs_to_collection": null,
- "budget": 150000000,
- "genres": [
- {
- "id": 28,
- "name": "Action"
- },
- {
- "id": 18,
- "name": "Drama"
- },
- {
- "id": 36,
- "name": "History"
- },
- {
- "id": 53,
- "name": "Thriller"
- },
- {
- "id": 10752,
- "name": "War"
- }
- ],
- "homepage": "http://www.dunkirkmovie.com/",
- "id": 374720,
- "imdb_id": "tt5013056",
- "original_language": "en",
- "original_title": "Dunkirk",
- "overview": "Miraculous evacuation of Allied soldiers from Belgium, Britain, Canada, and France, who were cut off and surrounded by the German army from the beaches and harbor of Dunkirk, France, between May 26 and June 04, 1940, during Battle of France in World War II.",
- "popularity": 73.777516,
- "poster_path": "/cUqEgoP6kj8ykfNjJx3Tl5zHCcN.jpg",
- "production_companies": [
- {
- "name": "Canal+",
- "id": 5358
- },
- {
- "name": "Studio Canal",
- "id": 5870
- },
- {
- "name": "Warner Bros.",
- "id": 6194
- },
- {
- "name": "Syncopy",
- "id": 9996
- },
- {
- "name": "RatPac-Dune Entertainment",
- "id": 41624
- },
- {
- "name": "Kaap Holland Film",
- "id": 67254
- }
- ],
- "production_countries": [
- {
- "iso_3166_1": "NL",
- "name": "Netherlands"
- },
- {
- "iso_3166_1": "FR",
- "name": "France"
- },
- {
- "iso_3166_1": "GB",
- "name": "United Kingdom"
- },
- {
- "iso_3166_1": "US",
- "name": "United States of America"
- }
- ],
- "release_date": "2017-07-19",
- "revenue": 107413488,
- "runtime": 107,
- "spoken_languages": [
- {
- "iso_639_1": "en",
- "name": "English"
- },
- {
- "iso_639_1": "fr",
- "name": "Français"
- }
- ],
- "status": "Released",
- "tagline": "The event that shaped our world",
- "title": "Dunkirk",
- "video": false,
- "vote_average": 7.5,
- "vote_count": 423
- }
- Link apiInterface = ApiClient.getApiClient().create(Link.class);
- Call<List<Model>> call = apiInterface.moviesList();
- call.enqueue(new Callback<List<Model>>() {
- @Override
- public void onResponse(Call<List<Model>> call, Response<List<Model>> response) {
- }
- @Override
- public void onFailure(Call<List<Model>> call, Throwable t) {
- t.printStackTrace();
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement