public boolean like(Post post) throws NotAuthentifiedException, OAuthMessageSignerException, OAuthExpectationFailedException, OAuthCommunicationException, ClientProtocolException, IOException, JSONException { String id = post.getId(); if (!isAuthentified()) throw new NotAuthentifiedException(NETWORK); ReadableResponse response = Utils.signedRequest( PUT, PUT_LIKE + id, httpOauthConsumer, JSON_TYPE, new ArrayList<NameValuePair>()); return reader.readResponse(response); }
public boolean comment(Post post, String comment) throws FileNotFoundException, MalformedURLException, IOException, NotAuthentifiedException, OAuthMessageSignerException, OAuthExpectationFailedException, OAuthCommunicationException, JSONException { if (!isAuthentified()) throw new NotAuthentifiedException(NETWORK); String entity = XML_ENTITY1 + comment + XML_ENTITY2; ReadableResponse response = Utils.signedRequest( POST2, POST_COMMENT + post.getId() + COMMENTS, httpOauthConsumer, XML_TYPE, entity); return reader.readResponse(response); }