Class BaseHttpClient
java.lang.Object
org.mbari.vars.annosaurus.sdk.r1.BaseHttpClient
- Direct Known Subclasses:
AnnosaurusHttpClient
,JwtHttpClient
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic HttpClient
newHttpClient
(Duration timeout) submit
(HttpRequest request, int okCode) Handle no content responses<T> CompletableFuture
<T> submit
(HttpRequest request, int okCode, Function<String, T> fn) Handle a request<T> CompletableFuture
<T> submitSearch
(HttpRequest request, int okCode, Function<String, T> fn, T defaultValue)
-
Field Details
-
log
-
debugLog
-
executor
-
-
Constructor Details
-
BaseHttpClient
-
-
Method Details
-
buildUri
-
newHttpClient
-
getHttpClient
-
getBaseUri
-
submit
Handle a request- Type Parameters:
T
- The type that the response body will be converted to- Parameters:
request
- The resuest to sendokCode
- The expected code if completed successfullyfn
- A function to handle the response body. If null then the body is ignored- Returns:
- A CompletableFuture that will complete when the request is done
-
submit
Handle no content responses- Parameters:
request
-okCode
-- Returns:
-
submitSearch
public <T> CompletableFuture<T> submitSearch(HttpRequest request, int okCode, Function<String, T> fn, T defaultValue)
-