Browse Source

Adds convenient overloaded constructor for Request.Options (#2093)

Co-authored-by: miwanczuk <michal.iwanczuk@empik.com>
Co-authored-by: Marvin Froeder <velo@users.noreply.github.com>
pull/2106/head
Michał Iwańczuk 1 year ago committed by GitHub
parent
commit
0d2590cc4a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 13
      core/src/main/java/feign/Request.java

13
core/src/main/java/feign/Request.java

@ -18,6 +18,7 @@ import static feign.Util.valuesOrEmpty; @@ -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 { @@ -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:
* <ul>

Loading…
Cancel
Save