File tree Expand file tree Collapse file tree
src/main/java/com/amilesend/tmdb/client Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -85,17 +85,38 @@ requires these APIs.
8585 <dependency >
8686 <groupId >com.amilesend</groupId >
8787 <artifactId >tmdb-java-client</artifactId >
88- <version >3.3.5 </version >
88+ <version >3.4 </version >
8989 </dependency >
9090 ```
91913 . Instantiate the client with the read access token:
9292
93+ Default:
9394 ``` java
9495 Tmdb tmdb = new Tmdb (" MyReadAccessToken" , " MyUserAgent/1.0" );
9596 // Access APIs (e.g., MoviesApi)
9697 MoviesApi moviesApi = tmdb. getMoviesApi();
9798 ```
9899
100+ With a RetryStrategy:
101+ ``` Java
102+ Tmdb tmdb = new Tmdb (new DefaultConnectionBuilder ()
103+ .userAgent(" MyUserAgent/1.0" )
104+ .baseUrl(Tmdb . API_URL )
105+ .httpClient(new OkHttpClient .Builder (). build())
106+ .authManager(new TokenAuthManager (new TokenAuthInfo (" MyReadAccessToken" )))
107+ .gsonFactory(new GsonFactory ())
108+ .isGzipContentEncodingEnabled(false )
109+ // Options are ExponentialDelayRetryStrategy, FixedDelayRetryStrategy
110+ // or NoRetryStrategy (default).
111+ .retryStrategy(ExponentialDelayRetryStrategy . builder()
112+ .baseDelayMs(500L )
113+ .maxJitterMs(100L )
114+ .maxAttempts(3 )
115+ .maxTotalDelayMs(2000L )
116+ .build())
117+ .build());
118+ ```
119+
99120<div align =" right " >(<a href =" #readme-top " >back to top</a >)</div >
100121
101122<a name =" recipes " ></a >
Original file line number Diff line number Diff line change 2525
2626 <groupId >com.amilesend</groupId >
2727 <artifactId >tmdb-java-client</artifactId >
28- <version >3.3.6-SNAPSHOT </version >
28+ <version >3.4 </version >
2929
3030 <name >tmdb-java-client</name >
3131 <description >A client to access the TMDB API</description >
Original file line number Diff line number Diff line change 6161 */
6262public class Tmdb {
6363 public static final String API_URL = "https://api.themoviedb.org/3" ;
64- public static final String USER_AGENT = "TMDBJavaClient/3.3 " ;
64+ public static final String USER_AGENT = "TMDBJavaClient/3.4 " ;
6565
6666 @ Getter
6767 private final Connection connection ;
You can’t perform that action at this time.
0 commit comments