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