// Build base RPC url based on listener and server
// one day all this URL hacking should be moved into the ContentNetwork...
ContentNetwork cn = ContentNetworkManagerFactory.getSingleton().getContentNetwork(
contentNetworkID);
if (cn == null) {
cn = ConstantsVuze.getDefaultContentNetwork();
}
String sURL_RPC = ContentNetworkUtils.getUrl(cn, ContentNetwork.SERVICE_RPC)
+ "&" + urlStem.toString();
// Build full url and data to send
String sURL;
String sPostData = null;
String sJSONPayload = UrlUtils.encode(JSONUtils.encodeToJSON(mapPayload));
if (USE_HTTP_POST) {
sURL = sURL_RPC;
sPostData = URL_POST_PLATFORM_DATA + "&payload=" + sJSONPayload;
sPostData = cn.appendURLSuffix(sPostData, true, sendAZID);
if (DEBUG_URL) {
debug("POST for " + mapProcessing.size() + ": " + sURL + "\n DATA: "
+ sPostData);
} else {
debug("POST for " + mapProcessing.size() + ": " + sURL);
}
} else {
sURL = sURL_RPC + URL_PLATFORM_MESSAGE + "&payload=" + sJSONPayload;
sURL = cn.appendURLSuffix(sURL, false, sendAZID);
if (DEBUG_URL) {
debug("GET: " + sURL);
} else {
debug("GET: " + sURL_RPC + URL_PLATFORM_MESSAGE);