Class SafeHttpPolicy
java.lang.Object
com.kingsrook.qqq.backend.core.utils.http.SafeHttpPolicy
Limits for
SafeHttpClient. Defaults: HTTPS only, no internal
targets, connect 5 s, read 10 s, total 30 s, responses read up to 64 KiB,
redirects never followed (a 3xx is returned as the response).-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncacheKey()A key that is equal for equal policies (used to share pooled clients).static SafeHttpPolicydefaults()The defaults.Getter for connectTimeout.Getter for internalAllowlist.intGetter for maxResponseBytes.Getter for readTimeout.Getter for totalTimeout.Getter for userAgent.booleanGetter for allowPlainHttp.withAllowPlainHttp(boolean allowPlainHttp) Allow http:// (default false: https only).withConnectTimeout(Duration connectTimeout) Connect timeout.withInternalAllowlist(List<String> internalAllowlist) Internal targets to allow (seeAddressRules).withMaxResponseBytes(int maxResponseBytes) Most response body bytes read; the rest is discarded with the connection.withReadTimeout(Duration readTimeout) Read (socket idle) timeout.withTotalTimeout(Duration totalTimeout) Whole-request timeout (connect, send and read together).withUserAgent(String userAgent) User-Agent header.
-
Constructor Details
-
SafeHttpPolicy
public SafeHttpPolicy()
-
-
Method Details
-
defaults
The defaults. -
cacheKey
A key that is equal for equal policies (used to share pooled clients). -
withAllowPlainHttp
Allow http:// (default false: https only). -
withInternalAllowlist
Internal targets to allow (seeAddressRules). -
withConnectTimeout
Connect timeout. -
withReadTimeout
Read (socket idle) timeout. -
withTotalTimeout
Whole-request timeout (connect, send and read together). -
withMaxResponseBytes
Most response body bytes read; the rest is discarded with the connection. -
withUserAgent
User-Agent header. -
isAllowPlainHttp
public boolean isAllowPlainHttp()Getter for allowPlainHttp. -
getInternalAllowlist
-
getConnectTimeout
Getter for connectTimeout. -
getReadTimeout
Getter for readTimeout. -
getTotalTimeout
Getter for totalTimeout. -
getMaxResponseBytes
public int getMaxResponseBytes()Getter for maxResponseBytes. -
getUserAgent
Getter for userAgent.
-