Package io.hanko.sdk.http
Class HankoHttpClientBase
java.lang.Object
io.hanko.sdk.http.HankoHttpClientBase
- Direct Known Subclasses:
HankoHttpClient
Abstract base client that performs actual requests to the Hanko API.
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
HankoHttpClientBase(HankoClientConfig config, org.apache.http.impl.client.CloseableHttpClient httpClient)
Base constructor. -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract org.slf4j.Logger
Get a loggerprotected HankoHttpResponse
makeRequest(HttpMethod method, String path)
Performs a request without a request body to the Hanko API.protected HankoHttpResponse
makeRequest(HttpMethod method, String path, String body)
Performs a request with a request body to the Hanko API.
-
Constructor Details
-
HankoHttpClientBase
protected HankoHttpClientBase(HankoClientConfig config, org.apache.http.impl.client.CloseableHttpClient httpClient)Base constructor.- Parameters:
config
- aHankoClientConfig
httpClient
- aCloseableHttpClient
-
-
Method Details
-
makeRequest
Performs a request without a request body to the Hanko API.- Parameters:
method
- theHttpMethod
for the requestpath
- the API endpoint path as a String- Returns:
- a
HankoHttpResponse
-
makeRequest
Performs a request with a request body to the Hanko API.- Parameters:
method
- theHttpMethod
for the requestpath
- the API endpoint path as a Stringbody
- nullable, the request body as a String- Returns:
- a
HankoHttpResponse
- Throws:
HankoApiConnectionException
- - if an error occurs connecting to the Hanko APIHankoClientException
- - if an error occurs during authorization header construction
-
getLogger
protected abstract org.slf4j.Logger getLogger()Get a logger- Returns:
- the
Logger
-