//Make invocation
Invocation invoc = null;
Metrix.event("doRestCommand() - about to prepare invocation");
if ("POST".equals(method)) {
if (outboundPayload != null && outboundPayload.size() > 0) {
FormDataMultiPart mp = new FormDataMultiPart();
//Copy params there
for (Map.Entry<String, List<String>> entry : options.entrySet()) {
String key = entry.getKey();
for (String val : entry.getValue()) {
mp.field(key, val);
}
}
//Copy outbound there
outboundPayload.addToMultipart(mp, logger);
Entity<FormDataMultiPart> entity = Entity.<FormDataMultiPart>entity(mp, mp.getMediaType());
invoc = request.build(method, entity);
} else {
Entity<ParameterMap> entity = Entity.<ParameterMap>entity(options, MediaType.APPLICATION_FORM_URLENCODED_TYPE);
invoc = request.build(method, entity);
}