Package weibo4j.http

Examples of weibo4j.http.PostParameter


     * @return the response
     * @throws WeiboException when Weibo service or network is unavailable
     */

    protected Response get(String url, String name1, String value1, boolean authenticate) throws WeiboException {
        return get(url, new PostParameter[]{new PostParameter(name1, value1)}, authenticate);
    }
View Full Code Here


     * @return the response
     * @throws WeiboException when Weibo service or network is unavailable
     */

    protected Response get(String url, String name1, String value1, String name2, String value2, boolean authenticate) throws WeiboException {
        return get(url, new PostParameter[]{new PostParameter(name1, value1), new PostParameter(name2, value2)}, authenticate);
    }
View Full Code Here

     */
    protected Response get(String url, PostParameter[] params, Paging paging, boolean authenticate) throws WeiboException {
        if (null != paging) {
            List<PostParameter> pagingParams = new ArrayList<PostParameter>(4);
            if (-1 != paging.getMaxId()) {
                pagingParams.add(new PostParameter("max_id", String.valueOf(paging.getMaxId())));
            }
            if (-1 != paging.getSinceId()) {
                pagingParams.add(new PostParameter("since_id", String.valueOf(paging.getSinceId())));
            }
            if (-1 != paging.getPage()) {
                pagingParams.add(new PostParameter("page", String.valueOf(paging.getPage())));
            }
            if (-1 != paging.getCount()) {
                if (-1 != url.indexOf("search")) {
                    // search api takes "rpp"
                    pagingParams.add(new PostParameter("rpp", String.valueOf(paging.getCount())));
                } else {
                    pagingParams.add(new PostParameter("count", String.valueOf(paging.getCount())));
                }
            }
            PostParameter[] newparams = null;
            PostParameter[] arrayPagingParams = pagingParams.toArray(new PostParameter[pagingParams.size()]);
            if (null != params) {
View Full Code Here

     * @see <a href="http://open.t.sina.com.cn/wiki/index.php/Statuses/update">statuses/update </a>
     */
    public Status updateStatus(String status) throws WeiboException{

      return new Status(http.post(getBaseURL() + "statuses/update.json",
                new PostParameter[]{new PostParameter("status", status)}, true));
        /*return new Status(http.post(getBaseURL() + "statuses/update.xml",
                new PostParameter[]{new PostParameter("status", status)}, true), this);*/
    }
View Full Code Here

     */
    public Comment updateComment(String comment, String id, String cid) throws WeiboException {
        PostParameter[] params = null;
        if (cid == null)
          params = new PostParameter[] {
          new PostParameter("comment", comment),
          new PostParameter("id", id)
        };
        else
          params = new PostParameter[] {
          new PostParameter("comment", comment),
          new PostParameter("cid", cid),
          new PostParameter("id", id)
        };
//      return new Comment(http.post(getBaseURL() + "statuses/comment.xml", params, true), this);
        return new Comment(http.post(getBaseURL() + "statuses/comment.json", params, true));
    }
View Full Code Here

     * @since Weibo4J 2.0.1
     * @see <a href="http://open.t.sina.com.cn/wiki/index.php/Statuses/upload">statuses/upload </a>
     */
    public Status uploadStatus(String status,ImageItem item) throws WeiboException {
      return new Status(http.multPartURL(getBaseURL() + "statuses/upload.json",
                new PostParameter[]{new PostParameter("status", status), new PostParameter("source", source)},item, true));
        /*return new Status(http.multPartURL(getBaseURL() + "statuses/upload.xml",
                new PostParameter[]{new PostParameter("status", status), new PostParameter("source", source)},item, true), this);*/
    }
View Full Code Here

                new PostParameter[]{new PostParameter("status", status), new PostParameter("source", source)},item, true), this);*/
    }

    public Status uploadStatus(String status,File file) throws WeiboException {
      return new Status(http.multPartURL("pic",getBaseURL() + "statuses/upload.json",
                new PostParameter[]{new PostParameter("status", status), new PostParameter("source", source)},file, true));
        /*return new Status(http.multPartURL(getBaseURL() + "statuses/upload.xml",
                new PostParameter[]{new PostParameter("status", status), new PostParameter("source", source)},item, true), this);*/
    }
View Full Code Here

       /* return new Status(http.post(getBaseURL() + "statuses/update.xml",
                new PostParameter[]{new PostParameter("status", status),
                        new PostParameter("lat", latitude),
                        new PostParameter("long", longitude)}, true), this);*/
      return new Status(http.post(getBaseURL() + "statuses/update.json",
                new PostParameter[]{new PostParameter("status", status),
                        new PostParameter("lat", latitude),
                        new PostParameter("long", longitude)}, true));
    }
View Full Code Here

     * @since Weibo4J 2.0.1
     * @see <a href="http://open.t.sina.com.cn/wiki/index.php/Statuses/update">statuses/update </a>
     */
    public Status updateStatus(String status, long inReplyToStatusId) throws WeiboException {
       return new Status(http.post(getBaseURL() + "statuses/update.json",
                 new PostParameter[]{new PostParameter("status", status), new PostParameter("in_reply_to_status_id", String.valueOf(inReplyToStatusId)), new PostParameter("source", source)}, true));
       /* return new Status(http.post(getBaseURL() + "statuses/update.xml",
                new PostParameter[]{new PostParameter("status", status), new PostParameter("in_reply_to_status_id", String.valueOf(inReplyToStatusId)), new PostParameter("source", source)}, true), this);*/
    }
View Full Code Here

                        new PostParameter("long", longitude),
                        new PostParameter("in_reply_to_status_id",
                                String.valueOf(inReplyToStatusId)),
                        new PostParameter("source", source)}, true), this);*/
      return new Status(http.post(getBaseURL() + "statuses/update.json",
                new PostParameter[]{new PostParameter("status", status),
                        new PostParameter("lat", latitude),
                        new PostParameter("long", longitude),
                        new PostParameter("in_reply_to_status_id",
                                String.valueOf(inReplyToStatusId)),
                        new PostParameter("source", source)}, true));
    }
View Full Code Here

TOP

Related Classes of weibo4j.http.PostParameter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.