Skip to content

Commit

Permalink
Adds convenient overloaded constructor for Request.Options (#2093)
Browse files Browse the repository at this point in the history
Co-authored-by: miwanczuk <michal.iwanczuk@empik.com>
Co-authored-by: Marvin Froeder <velo@users.noreply.github.com>
  • Loading branch information
3 people authored Jun 22, 2023
1 parent 50f5b6e commit 0d2590c
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions core/src/main/java/feign/Request.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import java.io.Serializable;
import java.net.HttpURLConnection;
import java.nio.charset.Charset;
import java.time.Duration;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
Expand Down Expand Up @@ -350,6 +351,18 @@ public Options(int connectTimeoutMillis, int readTimeoutMillis) {
this(connectTimeoutMillis, readTimeoutMillis, true);
}

/**
* Creates a new Options Instance.
*
* @param connectTimeout value.
* @param readTimeout value.
* @param followRedirects if the request should follow 3xx redirections.
*/
public Options(Duration connectTimeout, Duration readTimeout, boolean followRedirects) {
this(connectTimeout.toMillis(), TimeUnit.MILLISECONDS, readTimeout.toMillis(),
TimeUnit.MILLISECONDS, followRedirects);
}

/**
* Creates the new Options instance using the following defaults:
* <ul>
Expand Down

0 comments on commit 0d2590c

Please sign in to comment.