public class HttpClientUtil extends Object
HttpClient| Constructor and Description |
|---|
HttpClientUtil() |
| Modifier and Type | Method and Description |
|---|---|
static org.apache.http.client.protocol.HttpClientContext |
createPreemptiveBasicAuthentication(String host,
int port,
String user,
String password)
Returns context with AuthCache or null in case of any exception was thrown.
|
static org.apache.http.client.protocol.HttpClientContext |
createPreemptiveBasicAuthentication(String host,
int port,
String user,
String password,
String schema)
Returns context with AuthCache or null in case of any exception was thrown.
|
static byte[] |
responseToByteArray(org.apache.http.HttpResponse response) |
static InputStream |
responseToInputStream(org.apache.http.HttpResponse response) |
static String |
responseToString(org.apache.http.HttpResponse response) |
static String |
responseToString(org.apache.http.HttpResponse response,
Charset charset) |
static String |
responseToString(org.apache.http.HttpResponse response,
Charset charset,
boolean decode) |
public static String responseToString(org.apache.http.HttpResponse response) throws IOException
response - the httpresponse for processingIOExceptionpublic static String responseToString(org.apache.http.HttpResponse response, Charset charset) throws IOException
response - the httpresponse for processingcharset - the charset used for getting HttpEntityIOExceptionpublic static String responseToString(org.apache.http.HttpResponse response, Charset charset, boolean decode) throws IOException
response - the httpresponse for processingcharset - the charset used for getting HttpEntitydecode - determines if the result should be decoded or notIOExceptionpublic static InputStream responseToInputStream(org.apache.http.HttpResponse response) throws IOException
IOExceptionpublic static byte[] responseToByteArray(org.apache.http.HttpResponse response)
throws IOException
IOExceptionpublic static org.apache.http.client.protocol.HttpClientContext createPreemptiveBasicAuthentication(String host, int port, String user, String password, String schema)
host - port - user - password - schema - HttpClientContextpublic static org.apache.http.client.protocol.HttpClientContext createPreemptiveBasicAuthentication(String host, int port, String user, String password)
host - port - user - password - HttpClientContextCopyright © 2020 Hitachi Vantara. All rights reserved.