Exemplo n.º 1
0
        /** {@inheritDoc} */
        public override QQHttpRequest onBuildRequest()
        {
            ApacheHttpService httpService = getContext().getSerivce();
            QQSession         session     = getContext().getSession();
            Random            rand        = new Random();

            if (session.getClientId() == 0)
            {
                session.setClientId(rand.Next());         //random??
            }

            JSONObject json = new JSONObject();

            json.put("status", "online");
            json.put("ptwebqq", httpService.getCookie("ptwebqq", QQConstants.URL_CHANNEL_LOGIN).Value);
            json.put("passwd_sig", "");
            json.put("clientid", session.getClientId());
            json.put("psessionid", session.getSessionId());

            QQHttpRequest req = createHttpRequest("POST", QQConstants.URL_CHANNEL_LOGIN);

            req.addPostValue("r", json.ToString());
            req.addPostValue("clientid", session.getClientId() + "");
            req.addPostValue("psessionid", session.getSessionId());

            //req.addHeader("Referer", QQConstants.REFFER);
            return(req);
        }