diff --git a/core/src/main/java/feign/Request.java b/core/src/main/java/feign/Request.java index 1e590a48..d8d04784 100644 --- a/core/src/main/java/feign/Request.java +++ b/core/src/main/java/feign/Request.java @@ -18,6 +18,7 @@ import static feign.Util.valuesOrEmpty; 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; @@ -350,6 +351,18 @@ public final class Request implements Serializable { 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: *