ByteArrayEntity entity = new ByteArrayEntity(binary.getContent(), ContentType.parse(binary.getContentType()));
HttpRequestBase retVal = createRequest(url, entity);
return retVal;
}
IParser parser;
String contentType;
if (theEncoding == EncodingEnum.JSON) {
parser = myContext.newJsonParser();
contentType = Constants.CT_FHIR_JSON;
} else {
parser = myContext.newXmlParser();
contentType = Constants.CT_FHIR_XML;
}
String contents;
if (myTagList != null) {
contents = parser.encodeTagListToString(myTagList);
} else if (myBundle != null) {
contents = parser.encodeBundleToString(myBundle);
} else if (myResources != null) {
Bundle bundle = RestfulServer.createBundleFromResourceList(myContext, "", myResources, "", "", myResources.size());
contents = parser.encodeBundleToString(bundle);
} else {
contents = parser.encodeResourceToString(myResource);
}
StringEntity entity = new StringEntity(contents, ContentType.create(contentType, "UTF-8"));
HttpRequestBase retVal = createRequest(url, entity);