message = message.replace("&", "&");
LOG.info("Updating status " + message + " on " + UPDATE_STATUS_URL);
Map<String, String> headerParams = new HashMap<String, String>();
headerParams.put("Content-Type", "text/xml;charset=UTF-8");
String msgBody = String.format(STATUS_BODY, message);
Response serviceResponse = null;
try {
serviceResponse = authenticationStrategy.executeFeed(
UPDATE_STATUS_URL
+ authenticationStrategy.getAccessGrant().getKey(),
MethodType.POST.toString(), null, headerParams, msgBody);
} catch (Exception ie) {
throw new SocialAuthException("Failed to update status on "
+ UPDATE_STATUS_URL, ie);
}
LOG.debug("Status Updated and return status code is : "
+ serviceResponse.getStatus());
// return 201
return serviceResponse;
}