} else if (resourcePath.startsWith("/")) {
resourcePath = resourcePath.substring(1);
}
String reqPath = getApiPath() + resourcePath;
WebTarget target = client.target(getEndpoint()).path(reqPath);
InputStream in = null;
Entity<?> jsonPayload = null;
Map<String, String> sigParams = new HashMap<String, String>();
if (params != null) {
for (Map.Entry<String, List<String>> param : params.entrySet()) {
String key = param.getKey();
List<String> value = param.getValue();
if (value != null && !value.isEmpty() && value.get(0) != null) {
target = target.queryParam(key, value.toArray());
sigParams.put(key, value.get(0));
}
}
}
Invocation.Builder builder = target.request(MediaType.APPLICATION_JSON);
if (headers != null) {
for (Map.Entry<String, String> header : headers.entrySet()) {
builder.header(header.getKey(), header.getValue());
}