public VerifyCodeRes Verify(VerifyCodeReq req) { _VerifyCodeReq = req; var jsEngine = new JSEngine(Assembly.GetExecutingAssembly()); var now = jsEngine.Execute("TDC", "TDC.now").ToString(); _HttpClient.Reset(); _HttpClient.Url = VerifyURL.CombineParam(GetVerifyParam(now)); foreach (var item in GetImageParam()) { var requestParam = (RequestParam)item; if (requestParam.Key != "Random" && requestParam.Key != "ischartype" && requestParam.Key != "rand") { _HttpClient.PostingData.Add(requestParam.Key, requestParam.Value); } } _HttpClient.PostingData.Add("subcapclass", "0"); _HttpClient.PostingData.Add("cdata", "0"); var begintime = now.Substring(0, now.Length - 3); var endtime = (Convert.ToInt64(now) + 30000).ToString(); endtime = endtime.Substring(0, endtime.Length - 3); var focusBlurin = (Convert.ToInt64(now) + 16000).ToString(); var focusBlurout = focusBlurin; var json = "{\"mousemove\":[{\"t\":7,\"x\":206,\"y\":0},{\"t\":8,\"x\":203,\"y\":0},{\"t\":9,\"x\":204,\"y\":65},{\"t\":10,\"x\":240,\"y\":66},{\"t\":11,\"x\":240,\"y\":67}],\"mouseclick\":[{\"t\":8,\"x\":184,\"y\":76}],\"keyvalue\":[9,9,10,10],\"user_Agent\":\"chrome/56.0.2924.87\",\"resolutionx\":1280,\"resolutiony\":1024,\"winSize\":[300,152],\"url\":\"http://captcha.qq.com/cap_union_new_show\",\"refer\":\"http://xui.ptlogin2.qq.com/cgi-bin/xlogin\",\"begintime\":" + begintime + ",\"endtime\":" + endtime + ",\"platform\":1,\"os\":\"Win7\",\"keyboards\":4,\"flash\":1,\"pluginNum\":5,\"index\":1,\"ptcz\":\"\",\"tokenid\":262531355,\"btokenid\":null,\"tokents\":1487908779,\"ips\":{\"in\":[\"192.168.119.44\"]},\"colorDepth\":24,\"cookieEnabled\":true,\"timezone\":9,\"wDelta\":0,\"keyUpCnt\":4,\"keyUpValue\":[9,10,10,10],\"mouseUpValue\":[{\"t\":8,\"x\":184,\"y\":76},{\"t\":11,\"x\":235,\"y\":119}],\"mouseUpCnt\":2,\"mouseDownValue\":[{\"t\":8,\"x\":184,\"y\":74},{\"t\":11,\"x\":235,\"y\":119}],\"mouseDownCnt\":2,\"orientation\":[{\"x\":0,\"y\":0,\"z\":0}],\"bSimutor\":0,\"focusBlur\":{\"in\":[" + focusBlurin + "],\"out\":[" + focusBlurout + "],\"t\":[3136]},\"fVersion\":24,\"charSet\":\"UTF-8\",\"resizeCnt\":0,\"errors\":[],\"screenInfo\":\"1280-1024-984-24-*-*-*\",\"elapsed\":8000,\"clientType\":\"2\",\"trycnt\":1,\"refreshcnt\":0} "; var collect = jsEngine.Execute("TDC", "TDC.getData", json).ToString(); _HttpClient.PostingData.Add("collect", collect); _HttpClient.PostingData.Add("ans", req.VerifyCode); return(_HttpClient.POST().GetVerifyCode()); }
public void Shouldbe_POST_Request() { IHttpClient client = new DefaultHttpClient(); client.POST(); Assert.AreEqual(HttpVerb.POST, client.Verb); }
public void Shouldbe_URL_POST_Request() { var url = "http://test.com"; IHttpClient client = new DefaultHttpClient(); client.POST(url); Assert.AreEqual(HttpVerb.POST, client.Verb); Assert.AreEqual(url, client.Url); }
public static string FindQQ(this LoginedQQ loginedQQ, string qq) { DefaultHttpClient client = new DefaultHttpClient(); JSEngine engine = new JSEngine(Assembly.GetExecutingAssembly()); var cookieCollction = loginedQQ.Cookie.ToCookieCollection(); var ldw = engine.Execute("c_login_2", "getCSRFToken", cookieCollction.GetValueOf("Skey")).ToString(); client.Context.Cookies = cookieCollction; client.Url = "http://cgi.find.qq.com/qqfind/buddy/search_v3"; client.PostingData.Add("keyword", qq); client.PostingData.Add("online", "1"); client.PostingData.Add("ldw", ldw); return(client.POST().GetString()); }