Package org.apache.http.entity.mime.content

Examples of org.apache.http.entity.mime.content.StringBody


   */
  private MultipartEntity getInterfaceData(WeiBoDelParamBean paramBean) throws UnsupportedEncodingException {
    MultipartEntity reqEntity = new MultipartEntity();
   
    // AccessToken
    reqEntity.addPart("access_token", new StringBody(paramBean
        .getAccessToken()));

    // AppId
    reqEntity.addPart("oauth_consumer_key", new StringBody(oqu.getConfigValue("qq.appid")));

    // Openid
    reqEntity.addPart("openid", new StringBody(paramBean.getOpenId()));

    // 定义API返回的数据格式
    reqEntity.addPart("format", new StringBody("json"));
   
    // 微博消息的ID
    reqEntity.addPart("id", new StringBody(paramBean.getId()));
   
    return reqEntity;
  }
View Full Code Here


   * @throws UnsupportedEncodingException
   */
  private MultipartEntity getAddTopicParam(QqAddTopicParamBean addTopicBean) throws UnsupportedEncodingException {
    MultipartEntity reqEntity = new MultipartEntity();
    // AccessToken
    reqEntity.addPart("access_token", new StringBody(addTopicBean
        .getAccessToken()));
   
    // AppId
    reqEntity.addPart("oauth_consumer_key", new StringBody(oqu.getConfigValue("qq.appid")));
   
    // OpenId
    reqEntity.addPart("openid", new StringBody(addTopicBean.getOpenId()));
   
    // 定义API返回的数据格式
    reqEntity.addPart("format", new StringBody("json"));
   
    // 发布的心情的内容
    reqEntity.addPart("con", new StringBody(addTopicBean.getCon(), Charset.forName("UTF-8")));
   
    // 发布心情时引用的信息的类型
    if (addTopicBean.getRichtype() > 0) {
      // 1表示图片; 2表示网页; 3表示视频
      reqEntity.addPart("richtype", new StringBody(String.valueOf(addTopicBean.getRichtype())));
    }
   
    // 发布心情时引用的信息的值
    if (oqu.isNotNull(addTopicBean.getRichval())) {
      reqEntity.addPart("richval", new StringBody(addTopicBean.getRichval()));
    }
   
    // 发布心情时引用的地址
    if (oqu.isNotNull(addTopicBean.getLbsNm())) {
      reqEntity.addPart("lbs_nm", new StringBody(addTopicBean.getLbsNm()));
    }
   
    // 发布心情时引用的经度
    if (oqu.isNotNull(addTopicBean.getLbsX())) {
      reqEntity.addPart("lbs_x", new StringBody(addTopicBean.getLbsX()));
    }
   
    // 发布心情时引用的纬度
    if (oqu.isNotNull(addTopicBean.getLbsY())) {
      reqEntity.addPart("lbs_y", new StringBody(addTopicBean.getLbsY()));
    }
   
    // 第三方应用的平台类型
    if (oqu.isNotNull(addTopicBean.getLbsY())) {
      // 1表示QQ空间; 2表示腾讯朋友; 3表示腾讯微博平台; 4表示腾讯Q+平台
      reqEntity.addPart("third_source", new StringBody(addTopicBean.getThirdSource()));
    }
   
    return reqEntity;
  }
View Full Code Here

  private MultipartEntity getPostParam(QqAddBlogParamBean addBlogBean)
      throws UnsupportedEncodingException {
    MultipartEntity reqEntity = new MultipartEntity();

    // AccessToken
    reqEntity.addPart("access_token", new StringBody(addBlogBean
        .getAccessToken()));

    // AppId
    reqEntity.addPart("oauth_consumer_key", new StringBody(oqu.getConfigValue("qq.appid")));

    // Openid
    reqEntity.addPart("openid", new StringBody(addBlogBean.getOpenId()));

    // 定义API返回的数据格式
    reqEntity.addPart("format", new StringBody("json"));

    // 日志标题
    reqEntity.addPart("title", new StringBody(addBlogBean.getTitle(),
        Charset.forName("UTF-8")));

    // 日志内容
    reqEntity.addPart("content", new StringBody(addBlogBean.getContent(),
        Charset.forName("UTF-8")));

    return reqEntity;
  }
View Full Code Here

   */
  private MultipartEntity getAddWeiBoData(WeiBoAddParamBean paramBean) throws UnsupportedEncodingException {
    MultipartEntity reqEntity = new MultipartEntity();
   
    // AccessToken
    reqEntity.addPart("access_token", new StringBody(paramBean
        .getAccessToken()));

    // AppId
    reqEntity.addPart("oauth_consumer_key", new StringBody(oqu.getConfigValue("qq.appid")));

    // Openid
    reqEntity.addPart("openid", new StringBody(paramBean.getOpenId()));

    // 定义API返回的数据格式
    reqEntity.addPart("format", new StringBody("json"));
   
    // 微博内容
    reqEntity.addPart("content", new StringBody(paramBean.getContent(), Charset.forName("UTF-8")));
   
    // 用户ip
    if (oqu.isNotNull(paramBean.getClientIp())) {
      reqEntity.addPart("clientip", new StringBody(paramBean.getClientIp()));
    }
   
    // 用户所在地理位置的经度
    if (oqu.isNotNull(paramBean.getLongitude())) {
      reqEntity.addPart("jing", new StringBody(paramBean.getLongitude()));
    }
   
    // 用户所在地理位置的纬度
    if (oqu.isNotNull(paramBean.getLatitude())) {
      reqEntity.addPart("wei", new StringBody(paramBean.getLatitude()));
    }
   
    // 同步到QQ空间标识   0:同步 1:不同步
    if (oqu.isNotNull(paramBean.getSyncFlag())) {
      reqEntity.addPart("syncflag", new StringBody(paramBean.getSyncFlag()));
    }
   
    return reqEntity;
  }
View Full Code Here

   */
  private MultipartEntity getAddSharParam(QqAddShareParamBean addShareBean) throws UnsupportedEncodingException {
    MultipartEntity reqEntity = new MultipartEntity();
   
    // AccessToken
      reqEntity.addPart("access_token", new StringBody(addShareBean.getAccessToken()));
     
      // AppId
      reqEntity.addPart("oauth_consumer_key", new StringBody(oqu.getConfigValue("qq.appid")));
     
      // OpenId
      reqEntity.addPart("openid", new StringBody(addShareBean.getOpenId()));
   
    // 定义API返回的数据格式
      reqEntity.addPart("format", new StringBody("json"));
   
    // feeds的标题
      reqEntity.addPart("title", new StringBody(addShareBean.getTitle(), Charset.forName("UTF-8")));
   
    // 分享所在网页资源的链接
      reqEntity.addPart("url", new StringBody(addShareBean.getUrl()));
   
      // 用户评论内容,也叫发表分享时的分享理由
    if (oqu.isNotNull(addShareBean.getComment())) {
      reqEntity.addPart("comment", new StringBody(addShareBean.getComment(), Charset.forName("UTF-8")));
    }
   
    // 所分享的网页资源的摘要内容
    if (oqu.isNotNull(addShareBean.getSummary())) {
      reqEntity.addPart("summary", new StringBody(addShareBean.getSummary(), Charset.forName("UTF-8")));
    }
   
    // 所分享的网页资源的代表性图片链接
    if (oqu.isNotNull(addShareBean.getImages())) {
      reqEntity.addPart("images", new StringBody(addShareBean.getImages()));
    }
   
    // 分享的场景
    if (oqu.isNotNull(addShareBean.getSource())) {
      // 取值说明:1.通过网页 2.通过手机 3.通过软件 4.通过IPHONE 5.通过 IPAD
      reqEntity.addPart("source", new StringBody(addShareBean.getSource()));
    }
   
    // 分享内容的类型
    if (oqu.isNotNull(addShareBean.getType())) {
      // 4表示网页;5表示视频(type=5时,必须传入playurl)
      reqEntity.addPart("type", new StringBody(addShareBean.getType()));
    }
   
    // 长度限制为256字节。仅在type=5的时候有效。
    if (oqu.isNotNull(addShareBean.getPlayUrl())) {
      reqEntity.addPart("playurl", new StringBody(addShareBean.getPlayUrl()));
    }
   
    // 值为1时,表示分享不默认同步到微博,其他值或者不传此参数表示默认同步到微博。
    if (oqu.isNotNull(addShareBean.getNswb())) {
      reqEntity.addPart("nswb", new StringBody(addShareBean.getNswb()));
    }
   
    return reqEntity;
  }
View Full Code Here

   */
  private MultipartEntity getInterfaceData(WeiBoAddPicTParamBean paramBean) throws UnsupportedEncodingException {
    MultipartEntity reqEntity = new MultipartEntity();
   
    // AccessToken
      reqEntity.addPart("access_token", new StringBody(paramBean.getAccessToken()));
     
      // AppId
      reqEntity.addPart("oauth_consumer_key", new StringBody(oqu.getConfigValue("qq.appid")));
     
      // OpenId
      reqEntity.addPart("openid", new StringBody(paramBean.getOpenId()));
     
      // 表示要发表的微博内容
      reqEntity.addPart("content", new StringBody(paramBean.getContent(), Charset.forName("UTF-8")));
     
      // 定义API返回的数据格式
    reqEntity.addPart("format", new StringBody("json"));
   
    // 图片的内容
    FileBody fileBody = new FileBody(new File(paramBean.getPicPath()));
    reqEntity.addPart("pic", fileBody);
     
      // 用户ip
      if (oqu.isNotNull(paramBean.getClientIp())) {
        reqEntity.addPart("clientip", new StringBody(paramBean.getClientIp()));
    }
   
    // 用户所在地理位置的经度
    if (oqu.isNotNull(paramBean.getLongitude())) {
      reqEntity.addPart("jing", new StringBody(paramBean.getLongitude()));
    }
   
    // 用户所在地理位置的纬度
    if (oqu.isNotNull(paramBean.getLatitude())) {
      reqEntity.addPart("wei", new StringBody(paramBean.getLatitude()));
    }
   
    // 同步到QQ空间标识   0:同步 1:不同步
    if (oqu.isNotNull(paramBean.getSyncFlag())) {
      reqEntity.addPart("syncflag", new StringBody(paramBean.getSyncFlag()));
    }
     
    return reqEntity;
  }
View Full Code Here

   */
  private MultipartEntity getUpdatePicParam(QqUpdatePicParamBean paramBean) throws UnsupportedEncodingException {
    MultipartEntity reqEntity = new MultipartEntity();
   
    // AccessToken
      reqEntity.addPart("access_token", new StringBody(paramBean.getAccessToken()));
     
      // AppId
      reqEntity.addPart("oauth_consumer_key", new StringBody(oqu.getConfigValue("qq.appid")));
     
      // OpenId
      reqEntity.addPart("openid", new StringBody(paramBean.getOpenId()));
   
      // 照片描述
    if (oqu.isNotNull(paramBean.getPhotoDesc())) {
      reqEntity.addPart("photodesc", new StringBody(paramBean.getPhotoDesc(),Charset.forName("UTF-8")));
    }

    // 照片的命名
    if (oqu.isNotNull(paramBean.getTitle())) {
      reqEntity.addPart("title", new StringBody(paramBean.getTitle(),Charset.forName("UTF-8")));
    }
   
    // 相册id
    if (oqu.isNotNull(paramBean.getAlbumId())) {
      reqEntity.addPart("albumid", new StringBody(paramBean.getAlbumId()));
    }
   
    // 照片拍摄时的地理位置的经度
    if (oqu.isNotNull(paramBean.getLongitude())) {
      reqEntity.addPart("x", new StringBody(paramBean.getLongitude()));
    }
   
    // 照片拍摄时的地理位置的纬度
    if (oqu.isNotNull(paramBean.getLatitude())) {
      reqEntity.addPart("y", new StringBody(paramBean.getLatitude()));
    }
   
    // 定义API返回的数据格式
    reqEntity.addPart("format", new StringBody("json"));
   
    // 标识上传照片时是否要发feed
    reqEntity.addPart("needfeed", new StringBody(String.valueOf(paramBean.getNeedFeed())));
   
    // 已成功上传的张数
    if (paramBean.getSuccessNum() > 0) {
      reqEntity.addPart("successnum", new StringBody(String.valueOf(paramBean.getSuccessNum())));
    }
   
    // 批量上传照片的总张数
    if (paramBean.getPicNum() > 0) {
      reqEntity.addPart("picnum", new StringBody(String.valueOf(paramBean.getPicNum())));
    }
   
    // 图片的内容
    FileBody fileBody = new FileBody(new File(paramBean.getPicPath()));
    reqEntity.addPart("picture", fileBody);
View Full Code Here

   */
  private MultipartEntity getAddAlbumParam(QqAddAlbumParamBean addAlbumBean) throws UnsupportedEncodingException {
    MultipartEntity reqEntity = new MultipartEntity();
   
    // AccessToken
      reqEntity.addPart("access_token", new StringBody(addAlbumBean.getAccessToken()));
     
      // AppId
      reqEntity.addPart("oauth_consumer_key", new StringBody(oqu.getConfigValue("qq.appid")));
     
      // OpenId
      reqEntity.addPart("openid", new StringBody(addAlbumBean.getOpenId()));
   
    // 相册名
      reqEntity.addPart("albumname", new StringBody(addAlbumBean.getAlbumName(), Charset.forName("UTF-8")));
   
      // 相册描述
    if (oqu.isNotNull(addAlbumBean.getAlbumDesc())) {
      reqEntity.addPart("albumdesc", new StringBody(addAlbumBean.getAlbumDesc(), Charset.forName("UTF-8")));
    }
   
    // 相册权限
    if (addAlbumBean.getAlbumPriv() > 0) {
      reqEntity.addPart("priv", new StringBody(String.valueOf(addAlbumBean.getAlbumPriv())));
    }
   
    // 定义API返回的数据格式
    reqEntity.addPart("format", new StringBody("json"));
   
    return reqEntity;
  }
View Full Code Here

   */
  private MultipartEntity getInterfaceParam(WeiBoDelIdolParamBean paramBean) throws UnsupportedEncodingException {
    MultipartEntity reqEntity = new MultipartEntity();
   
    // AccessToken
    reqEntity.addPart("access_token", new StringBody(paramBean
        .getAccessToken()));

    // AppId
    reqEntity.addPart("oauth_consumer_key", new StringBody(oqu.getConfigValue("qq.appid")));

    // Openid
    reqEntity.addPart("openid", new StringBody(paramBean.getOpenId()));

    // 定义API返回的数据格式
    reqEntity.addPart("format", new StringBody("json"));
   
    // 要收听的用户的账户名列表
    if (oqu.isNotNull(paramBean.getName())) {
      reqEntity.addPart("name", new StringBody(paramBean.getName(), Charset.forName("UTF-8")));
    }
   
    // 要收听的用户的openid列表
    if (oqu.isNotNull(paramBean.getFopenIds())) {
      reqEntity.addPart("fopenids", new StringBody(paramBean.getFopenIds()));
    }
   
    return reqEntity;
  }
View Full Code Here

   */
  private MultipartEntity getInterfaceParam(WeiBoAddIdolParamBean paramBean) throws UnsupportedEncodingException {
    MultipartEntity reqEntity = new MultipartEntity();
   
    // AccessToken
    reqEntity.addPart("access_token", new StringBody(paramBean
        .getAccessToken()));

    // AppId
    reqEntity.addPart("oauth_consumer_key", new StringBody(oqu.getConfigValue("qq.appid")));

    // Openid
    reqEntity.addPart("openid", new StringBody(paramBean.getOpenId()));

    // 定义API返回的数据格式
    reqEntity.addPart("format", new StringBody("json"));
   
    // 要收听的用户的账户名列表
    if (oqu.isNotNull(paramBean.getName())) {
      reqEntity.addPart("name", new StringBody(paramBean.getName(), Charset.forName("UTF-8")));
    }
   
    // 要收听的用户的openid列表
    if (oqu.isNotNull(paramBean.getFopenIds())) {
      reqEntity.addPart("fopenids", new StringBody(paramBean.getFopenIds()));
    }
   
    return reqEntity;
  }
View Full Code Here

TOP

Related Classes of org.apache.http.entity.mime.content.StringBody

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.