if (debug != null) {
debug.println("Data: " + sendData);
}
String sendDataString = (String) sendData;
httpRequest.setRequestContent(new Utf8StringByteSource(sendDataString));
} else {
switch (sendDataFormat) {
case XML:
if (debug != null) {
debug.println("Data: [XML Content]");
}
JaxbHelper jaxbHelper = JaxbHelper.get(sendData.getClass());
String xml = jaxbHelper.marshal(sendData, false);
httpRequest.setRequestContent(new Utf8StringByteSource(xml));
// jaxbHelper.marshal(sendData, false, getOutputStream());
break;
case JSON:
if (debug != null) {
debug.println("Data: [JSON Content]");
}
JsonHelper jsonHelper = JsonHelper.build(sendData.getClass());
String json = jsonHelper.marshal(sendData, false);
httpRequest.setRequestContent(new Utf8StringByteSource(json));
// jsonHelper.marshal(sendData, false, getOutputStream());
break;
default:
throw new IllegalStateException();
}