Package io.split.service
Class SplitHttpClientImpl
- java.lang.Object
-
- io.split.service.SplitHttpClientImpl
-
- All Implemented Interfaces:
SplitHttpClient,Closeable,AutoCloseable
public final class SplitHttpClientImpl extends Object implements SplitHttpClient
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()static SplitHttpClientImplcreate(org.apache.hc.client5.http.impl.classic.CloseableHttpClient client, RequestDecorator requestDecorator, String apikey, SDKMetadata metadata)SplitHttpResponseget(URI uri, FetchOptions options, Map<String,List<String>> additionalHeaders)Wrapper for HTTP get methodSplitHttpResponsepost(URI uri, String body, Map<String,List<String>> additionalHeaders)Wrapper for HTTP post method
-
-
-
Method Detail
-
create
public static SplitHttpClientImpl create(org.apache.hc.client5.http.impl.classic.CloseableHttpClient client, RequestDecorator requestDecorator, String apikey, SDKMetadata metadata) throws URISyntaxException
- Throws:
URISyntaxException
-
get
public SplitHttpResponse get(URI uri, FetchOptions options, Map<String,List<String>> additionalHeaders)
Description copied from interface:SplitHttpClientWrapper for HTTP get method- Specified by:
getin interfaceSplitHttpClient- Parameters:
uri- the URL to be usedoptions- The FetchOptions object that contains headers.- Returns:
- The response structure SplitHttpResponse
-
post
public SplitHttpResponse post(URI uri, String body, Map<String,List<String>> additionalHeaders) throws IOException
Description copied from interface:SplitHttpClientWrapper for HTTP post method- Specified by:
postin interfaceSplitHttpClient- Parameters:
uri- the URL to be usedbody- HttpEntity object that has The body loadadditionalHeaders- Any additional headers to be added.- Returns:
- The response structure SplitHttpResponse
- Throws:
IOException
-
close
public void close() throws IOException- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-
-