binders(new MultiPartClientBinder(), new JettisonBinder()));
realClient.configuration().register(new CsrfProtectionFilter());
if ((userName != null) && (password != null)) {
realClient.configuration().register(new HttpBasicAuthFilter(userName, password));
}
realClient.configuration().register(new ClientRequestFilter() {
@Override
public void filter(ClientRequestContext rc) throws IOException {
for (Map.Entry<String, String> entry : headers.entrySet()) {
rc.getHeaders().add(entry.getKey(), entry.getValue());