关于用IDhttp发送网站http头的问题

咒你晴天堤

咒你晴天堤

2016-02-19 19:58

生活已是百般艰难,为何不努力一点。下面图老师就给大家分享关于用IDhttp发送网站http头的问题,希望可以让热爱学习的朋友们体会到设计的小小的乐趣。

  关于用IDhttp发送网站http头的问题
  
  近来发现在一个怪问题,第一次发送http头反回数据都正常,但第二次就不正常了,因为第一次请求时返回了一个cookie 。第二次发送时就连这个cookie 也发过去了。本来也没错,但就是这个cookie 的位置不对,倒置发送的http头错误。

(本文来源于图老师网站,更多请访问https://m.tulaoshi.com/bianchengyuyan/)

  看下面的的第一次请求正常:
  GET http://www.paymesurf.com:80/surf3.php?usrid=879 HTTP/1.1
  Content-Type: text/html
  Proxy-Connection: Keep-Alive
  Host: www.paymesurf.com
  Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/vnd.ms-powerpoint, application/vnd.ms-excel, application/msword, application/x-shockwave-flash, */*
  Accept-Language: zh-cn
  User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; MyIE2; CustomExchangeBrowser; .NET CLR 1.1.4322)
   
  返回数据:
  HTTP/1.0 200 OK
  Date: Fri, 20 May 2005 06:29:55 GMT
  Server: Apache/1.3.33 (Unix) mod_auth_passthrough/1.8 mod_log_bytes/1.2 mod_bwlimited/1.4 PHP/4.3.10 FrontPage/5.0.2.2635 mod_ssl/2.8.22 OpenSSL/0.9.7a
  X-Powered-By: PHP/4.3.10
  Set-Cookie: PHPSESSID=66b3ae6788a076324ad5c62e8fcaedbe; path=/
  Expires: Thu, 19 Nov 1981 08:52:00 GMT
  Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
  Pragma: no-cache
  Content-Type: text/html
  X-Cache: MISS from KShield
  X-Cache-Lookup: MISS from KShield:8080
  Proxy-Connection: close
  
  第二次请求就变成这样了:
  GET http://www.paymesurf.com:80/bar3.php?usrid=879&PHPSESSID=66b3ae6788a076324ad5c62e8fcaedbe HTTP/1.1
  Content-Type: text/html
  
  Proxy-Connection: Keep-Alive
  Host: www.paymesurf.com
  Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/vnd.ms-powerpoint, application/vnd.ms-excel, application/msword, application/x-shockwave-flash, */*
  Accept-Language: zh-cn
  Referer: http://www.paymesurf.com/surf3.php?usrid=879
  User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; MyIE2; CustomExchangeBrowser; .NET CLR 1.1.4322)
  Cookie: PHPSESSID=66b3ae6788a076324ad5c62e8fcaedbe
  
  令人奇怪的是,在我的电脑里运行正常,而发给别人用就不正常,是不是因为我的电脑里有indy的组件呢。还是什么原因,郁闷呀,哪位大哥可以帮我解答呀。QQ:402391462 ,注明:idhttp。谢谢

  代码如下:
  
  第一次请求:
       idsearch.Request.Accept:='image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/vnd.ms-powerpoint, application/vnd.ms-excel, application/msword, application/x-shockwave-flash, */*';
      idsearch.Request.AcceptLanguage:='zh-cn';
      idsearch.Request.UserAgent:='Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; MyIE2; CustomExchangeBrowser; .NET CLR 1.1.4322)';
      idsearch.Request.ProxyConnection:='Keep-Alive' ;
      idsearch.Request.ContentType:='text/html';
      SurfUrl:='http://www.paymesurf.com:80/surf3.php?usrid=879 '
      tmpstr:=idsearch.Get(SurfUrl);
      if  tmpstr='' then
          writeLog('连接网站失败..')
      else
          writeLog('连接网站成功..');
  :第二次请求:
  cookiestr:='cookie :asdfjiwerfksldafjiweflkasdjfiw'
  idsearch.Request.CustomHeaders.Text:=cookiestr;
  surfurl1:='http://www.paymesurf.com:80/bar3.php?usrid=879 '
      idsearch.request.Referer:=SurfUrl;
   try
          tmpstr:=idsearch.get(surfurl1);
      except
            writeLog('失败..');
      end;
  就是这里返回数据出错了。

(本文来源于图老师网站,更多请访问https://m.tulaoshi.com/bianchengyuyan/)

  如何解决呀。

展开更多 50%)
分享

猜你喜欢

关于用IDhttp发送网站http头的问题

编程语言 网络编程
关于用IDhttp发送网站http头的问题

用clientsocket发送http头请求

编程语言 网络编程
用clientsocket发送http头请求

s8lol主宰符文怎么配

英雄联盟 网络游戏
s8lol主宰符文怎么配

八、设置HTTP应答头

Java JAVA基础
八、设置HTTP应答头

五、读取HTTP请求头

Java JAVA基础
五、读取HTTP请求头

lol偷钱流符文搭配推荐

英雄联盟 网络游戏
lol偷钱流符文搭配推荐

HTTP消息头字段深入介绍

Web开发
HTTP消息头字段深入介绍

使用XML HTTP发送超长XML表单数据

Web开发
使用XML HTTP发送超长XML表单数据

lolAD刺客新符文搭配推荐

英雄联盟
lolAD刺客新符文搭配推荐

DreamWeaver让网页“活蹦乱跳”

DreamWeaver让网页“活蹦乱跳”

Delphi中建议使用的语句

Delphi中建议使用的语句
下拉加载更多内容 ↓