Class ApacheHC5RDF4JHttpClient
java.lang.Object
org.eclipse.rdf4j.http.client.apache5.ApacheHC5RDF4JHttpClient
- All Implemented Interfaces:
AutoCloseable, RDF4JHttpClient
RDF4JHttpClient implementation backed by Apache HttpComponents 5.-
Constructor Summary
ConstructorsConstructorDescriptionApacheHC5RDF4JHttpClient(org.apache.hc.client5.http.impl.classic.CloseableHttpClient httpClient, int maxConnectionsPerRoute, org.apache.hc.client5.http.config.RequestConfig defaultRequestConfig) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Closes this client and releases any resources held (e.g., connection pools, threads).execute(HttpRequest request) Executes the given HTTP request and returns the response.
-
Constructor Details
-
ApacheHC5RDF4JHttpClient
public ApacheHC5RDF4JHttpClient(org.apache.hc.client5.http.impl.classic.CloseableHttpClient httpClient, int maxConnectionsPerRoute, org.apache.hc.client5.http.config.RequestConfig defaultRequestConfig)
-
-
Method Details
-
execute
Description copied from interface:RDF4JHttpClientExecutes the given HTTP request and returns the response.The caller must close the returned
HttpResponseafter use to release connection resources.- Specified by:
executein interfaceRDF4JHttpClient- Parameters:
request- the request to execute.- Returns:
- the HTTP response.
- Throws:
IOException- if a network or I/O error occurs.
-
close
public void close()Description copied from interface:RDF4JHttpClientCloses this client and releases any resources held (e.g., connection pools, threads).- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceRDF4JHttpClient
-