public class ApiInvoker extends Object
Modifier and Type | Field and Description |
---|---|
static SimpleDateFormat |
DATE_FORMAT
ISO 8601 date format.
|
static SimpleDateFormat |
DATE_TIME_FORMAT
ISO 8601 date time format.
|
Constructor and Description |
---|
ApiInvoker() |
Modifier and Type | Method and Description |
---|---|
void |
addDefaultHeader(String key,
String value) |
static Object |
deserialize(String json,
String containerType,
Class cls) |
static String |
deserializeError(String json) |
void |
enableDebug() |
String |
escapeString(String str) |
static String |
formatDate(Date date) |
static String |
formatDateTime(Date datetime) |
static ApiInvoker |
getInstance() |
void |
initialize(String providerId,
String providerSecret) |
String |
invokeAPI(String host,
String path,
String method,
Map<String,String> queryParams,
Object body,
Map<String,String> headerParams,
Map<String,String> formParams,
String contentType) |
static String |
parameterToString(Object param) |
static Date |
parseDate(String str) |
static Date |
parseDateTime(String str) |
static String |
serialize(Object obj) |
static void |
setUserAgent(String userAgent) |
public static final SimpleDateFormat DATE_FORMAT
https://en.wikipedia.org/wiki/ISO_8601
public static final SimpleDateFormat DATE_TIME_FORMAT
https://en.wikipedia.org/wiki/ISO_8601
public static Object deserialize(String json, String containerType, Class cls) throws ApiException
ApiException
public static String deserializeError(String json) throws ApiException
ApiException
public void enableDebug()
public static ApiInvoker getInstance()
public String invokeAPI(String host, String path, String method, Map<String,String> queryParams, Object body, Map<String,String> headerParams, Map<String,String> formParams, String contentType) throws ApiException
ApiException
public static String serialize(Object obj) throws ApiException
ApiException
public static void setUserAgent(String userAgent)
Copyright © 2015. All rights reserved.