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 processingIOException
public static String responseToString(org.apache.http.HttpResponse response, Charset charset) throws IOException
response
- the httpresponse for processingcharset
- the charset used for getting HttpEntityIOException
public 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 notIOException
public static InputStream responseToInputStream(org.apache.http.HttpResponse response) throws IOException
IOException
public static byte[] responseToByteArray(org.apache.http.HttpResponse response) throws IOException
IOException
public static org.apache.http.client.protocol.HttpClientContext createPreemptiveBasicAuthentication(String host, int port, String user, String password, String schema)
host
- port
- user
- password
- schema
- HttpClientContext
public static org.apache.http.client.protocol.HttpClientContext createPreemptiveBasicAuthentication(String host, int port, String user, String password)
host
- port
- user
- password
- HttpClientContext
Copyright © 2020 Hitachi Vantara. All rights reserved.