String type = headers.get("Content-type");
try {
handlerFor(type).marshal(payload, writer, client);
writer.flush();
HttpEntityEnclosingRequestBase verb = (HttpEntityEnclosingRequestBase) verbFor(method, uri);
add(verb, headers);
String string = writer.getBuffer().toString();
verb.setEntity(new StringEntity(string));
return execute(details, verb);
} catch (IOException e) {
throw new RestfulieException("Unable to marshal entity.", e);
}