Package iqq.im.service

Examples of iqq.im.service.HttpService


  }

  /** {@inheritDoc} */
  @Override
  public QQHttpRequest onBuildRequest() throws QQException, JSONException {
    HttpService httpService = (HttpService) getContext().getSerivce(QQService.Type.HTTP);
    QQSession session = getContext().getSession();
    Random rand = new Random();
    if(session.getClientId() == 0){
      session.setClientId(rand.nextInt()); //random??
    }
   
    JSONObject json = new JSONObject();
    json.put("status", status.getValue());
    json.put("ptwebqq", httpService.getCookie("ptwebqq",  QQConstants.URL_CHANNEL_LOGIN).getValue());
    json.put("passwd_sig", "");
    json.put("clientid", session.getClientId());
    json.put("psessionid", session.getSessionId());
   
    QQHttpRequest req = createHttpRequest("POST", QQConstants.URL_CHANNEL_LOGIN);
View Full Code Here


  }

  /** {@inheritDoc} */
  @Override
  public QQHttpRequest onBuildRequest() throws QQException, JSONException {
        HttpService httpService = (HttpService) getContext().getSerivce(QQService.Type.HTTP);
        QQHttpCookie ptwebqq = httpService.getCookie("ptwebqq", QQConstants.URL_GET_USER_CATEGORIES);
    QQSession session = getContext().getSession();
        QQAccount account = getContext().getAccount();

    JSONObject json = new JSONObject();
    json.put("vfwebqq", session.getVfwebqq());
View Full Code Here

   * @param method a {@link java.lang.String} object.
   * @param url a {@link java.lang.String} object.
   * @return a {@link iqq.im.http.QQHttpRequest} object.
   */
  protected QQHttpRequest createHttpRequest(String method, String url){
    HttpService httpService = (HttpService) getContext().getSerivce(QQService.Type.HTTP);
    return httpService.createHttpRequest(method, url);
  }
View Full Code Here

  @Override
  public void execute() {
    try {
      switch (type) {
      case BUILD_REQUEST: {
        HttpService service = (HttpService) context.getSerivce(QQService.Type.HTTP);
        QQHttpRequest request = action.buildRequest();
        Future<QQHttpResponse> future = service.executeHttpRequest(request, new HttpAdaptor(context, action));
        action.setResponseFuture(future);
        }
        break;

      case CANCEL_REQUEST:
View Full Code Here

  /** {@inheritDoc} */
  @Override
  public QQHttpRequest onBuildRequest() throws QQException, JSONException {
    QQSession session = getContext().getSession();
    QQAccount account = getContext().getAccount();
    HttpService httpService = (HttpService) getContext().getSerivce(QQService.Type.HTTP);
    QQHttpCookie ptwebqq = httpService.getCookie("ptwebqq", QQConstants.URL_GET_USER_CATEGORIES);
   
    JSONObject json = new JSONObject();
    json.put("h", "hello");
    json.put("vfwebqq", session.getVfwebqq()); // 同上
    json.put("hash", QQEncryptor.hash(account.getUin() + "", ptwebqq.getValue()));
View Full Code Here

  }

  /** {@inheritDoc} */
  @Override
  protected QQHttpRequest onBuildRequest() throws QQException, JSONException {
    HttpService httpService = (HttpService) getContext().getSerivce(QQService.Type.HTTP);
    QQHttpRequest req = createHttpRequest("GET", QQConstants.URL_PT4_AUTH);
    req.addGetValue("daid", "4");
    req.addGetValue("appid", "1");
    req.addGetValue("auth_token", QQEncryptor.time33(httpService.getCookie("supertoken",  QQConstants.URL_CHANNEL_LOGIN).getValue()) + "");
    return req;
  }
View Full Code Here

   *
   * 设置HTTP的用户信息
   */
  @Override
  public void setHttpUserAgent(String userAgent) {
    HttpService http = getSerivce(QQService.Type.HTTP);
    http.setUserAgent(userAgent);
   
  }
View Full Code Here

   * 设置代理
   */
  @Override
  public void setHttpProxy(ProxyType proxyType, String proxyHost,
      int proxyPort, String proxyAuthUser, String proxyAuthPassword) {
    HttpService http = getSerivce(QQService.Type.HTTP);
    http.setHttpProxy(proxyType, proxyHost, proxyPort,
              proxyAuthUser, proxyAuthPassword);
  }
View Full Code Here

  /** {@inheritDoc} */
  @Override
  protected QQHttpRequest onBuildRequest() throws QQException, JSONException {

    HttpService httpService = (HttpService) getContext().getSerivce(
        QQService.Type.HTTP);
    QQSession session = getContext().getSession();

    QQHttpRequest req = createHttpRequest("POST",
        QQConstants.URL_UPLOAD_OFFLINE_PICTURE);
    req.addGetValue("time", System.currentTimeMillis() / 1000 + "");
    req.addPostFile("file", file);
    req.addPostValue("callback", "parent.EQQ.Model.ChatMsg.callbackSendPic");
    req.addPostValue("locallangid", "2052");
    req.addPostValue("clientversion", "1409");
    req.addPostValue("uin", getContext().getAccount().getUin() + ""); // 自己的账号
    req.addPostValue("skey", httpService.getCookie("skey",  QQConstants.URL_UPLOAD_OFFLINE_PICTURE).getValue());
    req.addPostValue("appid", "1002101");
    req.addPostValue("peeruin", user.getUin() + ""); // 图片对方UIN
    req.addPostValue("fileid", "1");
    req.addPostValue("vfwebqq", session.getVfwebqq());
    req.addPostValue("senderviplevel", getContext().getAccount().getLevel().getLevel() + "");
View Full Code Here

TOP

Related Classes of iqq.im.service.HttpService

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.