Interface HttpClientProvider
- All Superinterfaces:
Provider
- Author:
- Stian Thorgersen
-
Method Summary
Modifier and TypeMethodDescriptionHelper methodorg.apache.http.impl.client.CloseableHttpClientReturns theCloseableHttpClientthat can be freely used.intHelper method
-
Method Details
-
getHttpClient
org.apache.http.impl.client.CloseableHttpClient getHttpClient()Returns theCloseableHttpClientthat can be freely used.The returned
HttpClientinstance must never beclose()d by the caller.Closing the
HttpClientinstance is responsibility of this provider. However, the objects created via the returnedHttpClientneed to be closed properly by the code that instantiated them.- Returns:
-
postText
Helper method- Parameters:
uri-text-- Returns:
- http response status
- Throws:
IOException
-
get
Helper method- Parameters:
uri-- Returns:
- response stream, you must close this stream or leaks will happen
- Throws:
IOException- On network errors, no content being returned or a non-2xx HTTP status code
-