Package com.belerweb.social.exception

Examples of com.belerweb.social.exception.SocialException


      String json =
          post("https://api.weixin.qq.com/cgi-bin/qrcode/create?access_token=" + accessToken,
              new StringEntity(request.toString()));
      return Result.parse(json, QRTicket.class);
    } catch (UnsupportedEncodingException e) {
      throw new SocialException(e);
    }
  }
View Full Code Here


      String json =
          post("https://api.weixin.qq.com/cgi-bin/message/custom/send?access_token=" + accessToken,
              new StringEntity(message.toJSON(), "UTF-8"));
      return new Result<Boolean>(Error.parse(new JSONObject(json)));
    } catch (UnsupportedEncodingException e) {
      throw new SocialException(e);
    }
  }
View Full Code Here

      String json =
          post("https://api.weixin.qq.com/cgi-bin/message/template/send?access_token="
              + accessToken, new StringEntity(message.toJSON(), "UTF-8"));
      return new Result<Boolean>(Error.parse(new JSONObject(json)));
    } catch (UnsupportedEncodingException e) {
      throw new SocialException(e);
    }
  }
View Full Code Here

      }
      Error error = new Error();
      error.setErrorCode(ret.toString());
      return new Result<String>(error);
    } catch (ClientProtocolException e) {
      throw new SocialException(e);
    } catch (HttpException e) {
      throw new SocialException(e);
    } catch (IOException e) {
      throw new SocialException(e);
    }
  }
View Full Code Here

  public String get(String url, List<NameValuePair> params) {
    try {
      return Http.get(url, params);
    } catch (HttpException e) {
      throw new SocialException(e);
    }
  }
View Full Code Here

  public String post(String url, HttpEntity postBody) {
    try {
      return Http.post(url, postBody);
    } catch (HttpException e) {
      throw new SocialException(e);
    }
  }
View Full Code Here

  public String post(String url, List<NameValuePair> params) {
    try {
      return Http.post(url, params, "UTF-8");
    } catch (HttpException e) {
      throw new SocialException(e);
    }
  }
View Full Code Here

    return post(url, (HttpEntity) null);
  }

  public void addParameter(List<NameValuePair> params, String name, Object value) {
    if (value == null) {
      throw new SocialException("Parameter " + name + " must not be null.");
    }
    params.add(new BasicNameValuePair(name, value.toString()));
  }
View Full Code Here

        return new Result<T>(parse(new JSONArray(json), resultType));
      } else {
        return parse(new JSONObject(json), resultType);
      }
    } catch (Exception e) {
      throw new SocialException(e);
    }
  }
View Full Code Here

        T obj = (T) parse.invoke(null, jsonObject);
        return new Result<T>(obj);
      }
      return new Result<T>(error);
    } catch (Exception e) {
      throw new SocialException(e);
    }
  }
View Full Code Here

TOP

Related Classes of com.belerweb.social.exception.SocialException

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.