public class HttpUtil
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_CONN_TIMEOUT_MS |
static int |
DEFAULT_SO_TIMEOUT_MS |
static java.lang.String |
GZIP |
static CoordinatedTime.SimpleDateFormatThread |
HTTP_TIME_FORMAT
HTTP Time per RFC 1123
|
static java.lang.String |
MIME_JSON |
static java.lang.String |
MIME_XML |
static java.lang.String |
MIME_ZIP |
Constructor and Description |
---|
HttpUtil() |
Modifier and Type | Method and Description |
---|---|
static void |
AddBasicAuthentication(HttpRequestBase request) |
static void |
AddBasicAuthentication(HttpRequestBase request,
AtakAuthenticationCredentials creds) |
static void |
AddBasicAuthentication(HttpRequestBase request,
BasicUserCredentials credentials)
Set Basic Auth headers, if provided.
|
static void |
AddBasicAuthentication(HttpRequestBase request,
java.lang.String user,
java.lang.String password) |
static HttpClient |
GetHttpClient(boolean bPreemptiveBasicAuth) |
static HttpClient |
GetHttpClient(boolean bPreemptiveBasicAuth,
long connTimeout,
long soTimeout) |
static HttpClient |
GetHttpClient(long connTimeout,
long soTimeout,
org.apache.http.conn.ssl.SSLSocketFactory socketFactory) |
static HttpClient |
GetHttpClient(org.apache.http.conn.ssl.SSLSocketFactory socketFactory) |
static org.apache.http.params.HttpParams |
initParams(long connTimeout,
long soTimeout) |
public static final java.lang.String GZIP
public static final java.lang.String MIME_XML
public static final java.lang.String MIME_JSON
public static final java.lang.String MIME_ZIP
public static final int DEFAULT_SO_TIMEOUT_MS
public static final int DEFAULT_CONN_TIMEOUT_MS
public static final CoordinatedTime.SimpleDateFormatThread HTTP_TIME_FORMAT
public static HttpClient GetHttpClient(org.apache.http.conn.ssl.SSLSocketFactory socketFactory)
public static HttpClient GetHttpClient(boolean bPreemptiveBasicAuth)
public static HttpClient GetHttpClient(long connTimeout, long soTimeout, org.apache.http.conn.ssl.SSLSocketFactory socketFactory)
public static HttpClient GetHttpClient(boolean bPreemptiveBasicAuth, long connTimeout, long soTimeout)
public static org.apache.http.params.HttpParams initParams(long connTimeout, long soTimeout)
public static void AddBasicAuthentication(HttpRequestBase request) throws AuthenticationException
AuthenticationException
public static void AddBasicAuthentication(HttpRequestBase request, AtakAuthenticationCredentials creds) throws AuthenticationException
AuthenticationException
public static void AddBasicAuthentication(HttpRequestBase request, java.lang.String user, java.lang.String password) throws AuthenticationException
AuthenticationException
public static void AddBasicAuthentication(HttpRequestBase request, BasicUserCredentials credentials)
request
- the request o set the basic authentication headers oncredentials
- the credentials to use