Back to project page ReadabilitySDK.
The source code is released under:
MIT License
If you think the Android project ReadabilitySDK listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.idemidov.readability.command; /*from ww w . j a va2 s.c o m*/ import com.idemidov.readability.command.params_builders.ParamsBuilder; import com.idemidov.readability.data.Bookmark; import com.idemidov.readability.parser.GetBookmarkByIdParser; import com.idemidov.readability.parser.Parser; import org.apache.http.client.entity.UrlEncodedFormEntity; import org.apache.http.client.methods.HttpPost; import org.apache.http.client.methods.HttpUriRequest; import org.json.JSONException; import java.io.UnsupportedEncodingException; import java.net.URISyntaxException; import oauth.signpost.OAuthConsumer; import oauth.signpost.commonshttp.CommonsHttpOAuthConsumer; import oauth.signpost.exception.OAuthCommunicationException; import oauth.signpost.exception.OAuthExpectationFailedException; import oauth.signpost.exception.OAuthMessageSignerException; public class PostBookmarkCommand extends BaseCommand<Bookmark> { private ParamsBuilder paramsBuilder; public PostBookmarkCommand(OAuthConsumer consumer, ParamsBuilder paramsBuilder) { super(consumer); this.paramsBuilder = paramsBuilder; } @Override Parser<Bookmark> getParser() { return new GetBookmarkByIdParser(); } @Override String getUrl() { return ROOT_URL.concat("bookmarks"); } @Override HttpUriRequest getHttpUriRequest() throws UnsupportedEncodingException { HttpPost post = new HttpPost(getUrl()); post.setHeader(CONTENT_TYPE_NAME, CONTENT_TYPE_VALUE); post.setEntity(new UrlEncodedFormEntity(paramsBuilder.build())); return post; } }