Skip to content

Commit 2af241a

Browse files
committedJan 5, 2025·
add documentation about the request timeout
1 parent b1c3810 commit 2af241a

File tree

1 file changed

+22
-21
lines changed

1 file changed

+22
-21
lines changed
 

‎mkdocs/docs/configuration.md

+22-21
Original file line numberDiff line numberDiff line change
@@ -19,27 +19,28 @@ Changing Unirest's config should ideally be done once, or rarely. Once Unirest h
1919

2020
## Config Options
2121

22-
| Builder Method | Impact | Default |
23-
| ------------- | ------------- | ------------- |
24-
| ```connectTimeout(int)``` | Sets the connection timeout for all requests in millis | 10000 |
25-
| ```proxy(proxy)``` | Sets a proxy object for negotiating proxy servers. Can include auth credentials | |
26-
| ```setDefaultHeader(String, String)``` | Sets a default header. Will overwrite if it exists | |
27-
| ```setDefaultHeader(String, Supplier<String>)``` | Sets a default header by supplier. Good for setting trace tokens for microservice architectures. Will overwrite if it exists | |
28-
| ```addDefaultHeader(String, String)``` | Adds a default header. Multiple for the same name can exist | |
29-
| ```addDefaultHeader(String, Supplier<String>)``` | Add a default header by supplier. Good for setting trace tokens for microservice architectures. | |
30-
| ```setDefaultBasicAuth(String, String)``` | Add a default Basic Auth Header | |
31-
| ```followRedirects(boolean)``` | toggle following redirects | true |
32-
| ```enableCookieManagement(boolean)``` | toggle accepting and storing cookies | true |
33-
| ```cookieSpec(String)``` | set a cookie policy. Acceptable values: 'default' (same as Netscape), 'netscape', 'ignoreCookies', 'standard' (RFC 6265 interoprability profile) , 'standard-strict' (RFC 6265 strict profile) | default |
34-
| ```automaticRetries(boolean)``` | toggle disabling automatic retries (up to 4 times) for socket timeouts | true |
35-
| ```verifySsl(boolean)``` |toggle enforcing SSL | true |
36-
| ```clientCertificateStore(String,String)``` | Add a PKCS12 KeyStore by path for doing client certificates | |
37-
| ```clientCertificateStore(KeyStore,String)``` | Add a PKCS12 KeyStore for doing client certificates | |
38-
| ```connectionTTL(long,TimeUnit)``` | Total time to live (TTL) defines maximum life span of persistent connections regardless of their expiration setting. No persistent connection will be re-used past its TTL value.| -1 |
39-
| ```connectionTTL(Duration)``` | Add total time to live (TTL) by [Duration](https://docs.oracle.com/javase/8/docs/api/java/time/Duration.html). Good for moderns Java APIs. | -1 |
40-
| ```errorHandler(Consumer<HttpResponse<?>> consumer)``` | Set a global error handler that will be invoked for any status > 400 or a parsing error | |
41-
| ```interceptor(Interceptor value)``` | Set a global Interceptor handler that will be invoked before and after each request | |
42-
| ```defaultBaseUrl(String value)``` | Set a default base URL to be used for all requests that do not already contain a scheme | |
22+
| Builder Method | Impact | Default |
23+
|--------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------|
24+
| ```connectTimeout(int)``` | Sets the connection timeout for all requests in millis | 10000 |
25+
| ```requestTimeout(int)``` | Sets the request timeout for all requests in millis | none (infinite) |
26+
| ```proxy(proxy)``` | Sets a proxy object for negotiating proxy servers. Can include auth credentials | |
27+
| ```setDefaultHeader(String, String)``` | Sets a default header. Will overwrite if it exists | |
28+
| ```setDefaultHeader(String, Supplier<String>)``` | Sets a default header by supplier. Good for setting trace tokens for microservice architectures. Will overwrite if it exists | |
29+
| ```addDefaultHeader(String, String)``` | Adds a default header. Multiple for the same name can exist | |
30+
| ```addDefaultHeader(String, Supplier<String>)``` | Add a default header by supplier. Good for setting trace tokens for microservice architectures. | |
31+
| ```setDefaultBasicAuth(String, String)``` | Add a default Basic Auth Header | |
32+
| ```followRedirects(boolean)``` | toggle following redirects | true |
33+
| ```enableCookieManagement(boolean)``` | toggle accepting and storing cookies | true |
34+
| ```cookieSpec(String)``` | set a cookie policy. Acceptable values: 'default' (same as Netscape), 'netscape', 'ignoreCookies', 'standard' (RFC 6265 interoprability profile) , 'standard-strict' (RFC 6265 strict profile) | default |
35+
| ```automaticRetries(boolean)``` | toggle disabling automatic retries (up to 4 times) for socket timeouts | true |
36+
| ```verifySsl(boolean)``` | toggle enforcing SSL | true |
37+
| ```clientCertificateStore(String,String)``` | Add a PKCS12 KeyStore by path for doing client certificates | |
38+
| ```clientCertificateStore(KeyStore,String)``` | Add a PKCS12 KeyStore for doing client certificates | |
39+
| ```connectionTTL(long,TimeUnit)``` | Total time to live (TTL) defines maximum life span of persistent connections regardless of their expiration setting. No persistent connection will be re-used past its TTL value. | -1 |
40+
| ```connectionTTL(Duration)``` | Add total time to live (TTL) by [Duration](https://docs.oracle.com/javase/8/docs/api/java/time/Duration.html). Good for moderns Java APIs. | -1 |
41+
| ```errorHandler(Consumer<HttpResponse<?>> consumer)``` | Set a global error handler that will be invoked for any status > 400 or a parsing error | |
42+
| ```interceptor(Interceptor value)``` | Set a global Interceptor handler that will be invoked before and after each request | |
43+
| ```defaultBaseUrl(String value)``` | Set a default base URL to be used for all requests that do not already contain a scheme | |
4344

4445
## Global Interceptor
4546
You can set a global interceptor for your configuration. This is invoked before and after each request.

0 commit comments

Comments
 (0)
Please sign in to comment.