Esempio n. 1
0
        public override QQHttpRequest OnBuildRequest()
        {
            QQHttpRequest req = null;

            switch (robotType)
            {
            case RobotType.Tuling:
            {
                req = CreateHttpRequest("GET", QQConstants.URL_ROBOT_TULING);
                req.AddGetValue("key", QQConstants.ROBOT_TULING_KEY);
                req.AddGetValue("info", input.GetText());
                // req.AddGetValue("userid", input.From.Uin.ToString());
                break;
            }

            case RobotType.Moli:
            {
                req = CreateHttpRequest("GET", QQConstants.URL_ROBOT_MOLI);
                req.AddGetValue("limit", "5");
                req.AddGetValue("question", input.GetText());
                req.AddGetValue("api_key", QQConstants.ROBOT_MOLI_KEY);
                req.AddGetValue("api_secret", QQConstants.ROBOT_MOLI_SECRET);
                // req.AddGetValue("type", "json");
                break;
            }
            }

            return(req);
        }
Esempio n. 2
0
        public override QQHttpRequest OnBuildRequest()
        {
            var req = CreateHttpRequest(HttpConstants.Post, QQConstants.URL_ROBOT_TULING);

            req.AddPostValue("key", QQConstants.ROBOT_TULING_KEY);
            req.AddPostValue("info", _input.GetText());
            req.AddPostValue("userid", _input.From.QQ.ToString());
            return(req);
        }