1

我想获取验证码图像。我已经捕获了使用提琴手获取图像的请求。

这是请求的原始文本。

GET http://api.minteye.com/slider/image.ashx?CaptchaId=4162&PublicKey=76dd4b3f-92d2-4d29-9cb8-740ccfca4fe4&w=300&h=250&dumm=635086078045177660&reqid=e112b222-0f38-4309-9ab4-791aa11590d8-2eb9&img=1 HTTP/1.1 主机:api.minteye.com 连接:keep-alive 用户代理:Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1453.116 Safari/537.36 Accept: / Referer: http ://abc-site.com/?param=value Accept-Encoding: gzip,deflate,sdch Accept-Language: en-US;q=0.8,en-US;q=0.6,en;q=0.4 Cookie: __utma =219856005.121997545.1372326418.1372834638.1372992381.5;__utmz=219856005.1372992381.5.2.utmcsr=api.minteye.com|utmccn=(推荐)|utmcmd=推荐|utmcct=/; ASP.NET_SessionId=oh543ydsa2z033ybv2cg0wwi;交换广告=10959011

之后,我制作了请求标头并将其发送到 getresponse。但我无法获得任何图像。(即使在提琴手中也看不到任何东西)

这是我的代码。

CookieContainer cookie = new CookieContainer();    
        request = (HttpWebRequest)HttpWebRequest.Create("http://api.minteye.com/slider/image.ashx?CaptchaId=4162&PublicKey=76dd4b3f-92d2-4d29-9cb8-740ccfca4fe4&w=300&h=250&dumm=4211089392&reqid=8075f74e-7878-4a9a-a5a0-3c21b5fbfb79-5f5f&img=5");            
        request.KeepAlive = true;            
        request.Accept = "*/*";
        request.UserAgent = "Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1453.116 Safari/537.36";
        request.Referer = "http://abc-site.com/?param=value";                        
        request.Headers.Add("Accept-Language: en-US;q=0.8,en-US;q=0.6,en;q=0.4");
        request.CookieContainer = cookie;
        response = (HttpWebResponse)request.GetResponse();

运行此代码时,fiddler 会捕获请求及其响应,但不会获得任何图像。怎么了?

4

1 回答 1

0

如果你给我你的来源,我可以看看你是如何成为 requestID 的,你可以用这个 requestID 为这个图像创建 URL。使用此 URL,您可以使用简单的 WebClient 下载它;)

于 2013-07-20T15:10:44.950 回答