Interface HttpClientProvider
- All Superinterfaces:
Provider
- Author:
- Stian Thorgersen
-
Method Summary
Modifier and TypeMethodDescriptionHelper methodorg.apache.http.impl.client.CloseableHttpClient
Returns theCloseableHttpClient
that can be freely used.int
Helper method
-
Method Details
-
getHttpClient
org.apache.http.impl.client.CloseableHttpClient getHttpClient()Returns theCloseableHttpClient
that can be freely used.The returned
HttpClient
instance must never beclose()
d by the caller.Closing the
HttpClient
instance is responsibility of this provider. However, the objects created via the returnedHttpClient
need 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
-