TweetPhotoResponse favorite(long userId, long photoId) {
String urlToRequest = "http://tweetphotoapi.com/api/tpapi.svc/users/" + userId + "/favorites/" + photoId;
try {
HttpConnection httpConn = HttpUtils.makeHttpConnection(urlToRequest, new HttpHeaders(), null, getCoverageBasedConnectionType(), "POST", this, false);
m_httpStatus = httpConn.getResponseCode();
if (m_httpStatus != 201) {
System.out.println("Error: " + m_httpStatus);
} else {
InputStream content = httpConn.openInputStream();
String xml = convertStreamToString(content);
DomTweetPhotoResponseParser responseParser = new DomTweetPhotoResponseParser();
responseParser.m_Xml = xml;
TweetPhotoResponse response = (TweetPhotoResponse)responseParser.parse();
content.close();