Package io.avaje.http.client
Interface HttpClientContext.Builder
-
- Enclosing interface:
- HttpClientContext
public static interface HttpClientContext.Builder
Builds the HttpClientContext.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description HttpClientContext
build()
Build and return the context.HttpClientContext.Builder
with(HttpClient client)
Set the underlying HttpClient to use.HttpClientContext.Builder
withBaseUrl(String baseUrl)
Set the base URL to use for requests created from the context.HttpClientContext.Builder
withBodyAdapter(BodyAdapter adapter)
Set the body adapter to use to convert beans to body content and response content back to beans.HttpClientContext.Builder
withCookieHandler(CookieHandler cookieHandler)
Specify a cookie handler to use on the HttpClient.HttpClientContext.Builder
withRequestTimeout(Duration requestTimeout)
Set the default request timeout.HttpClientContext.Builder
withResponseListener(ResponseListener requestListener)
Add a response listener.
-
-
-
Method Detail
-
with
HttpClientContext.Builder with(HttpClient client)
Set the underlying HttpClient to use.
-
withBaseUrl
HttpClientContext.Builder withBaseUrl(String baseUrl)
Set the base URL to use for requests created from the context.
-
withRequestTimeout
HttpClientContext.Builder withRequestTimeout(Duration requestTimeout)
Set the default request timeout.
-
withBodyAdapter
HttpClientContext.Builder withBodyAdapter(BodyAdapter adapter)
Set the body adapter to use to convert beans to body content and response content back to beans.
-
withResponseListener
HttpClientContext.Builder withResponseListener(ResponseListener requestListener)
Add a response listener. Note thatRequestLogger
is an implementation for debug logging request/response headers and content.
-
withCookieHandler
HttpClientContext.Builder withCookieHandler(CookieHandler cookieHandler)
Specify a cookie handler to use on the HttpClient. This would override the default cookie handler.
-
build
HttpClientContext build()
Build and return the context.
-
-