(紧急)Idhttp 无法正确解释302的http数据包,如何解决?

gunakid2 2007-10-19 08:31:45
使用Idhttp控件post了一个数据包之后,服务器返回302数据包如下:
HTTP/1.1 302 Found
Date: Fri, 19 Oct 2007 08:37:15 GMT
Server: Apache
X-Powered-By: PHP/4.4.7
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
Location: ?receipt=13325460&soccer=1
Keep-Alive: timeout=30
Connection: Keep-Alive
Transfer-Encoding: chunked
Content-Type: text/html; charset=gb2312
正常情况应该重定向到:
GET /user_as/betting-entry.php?receipt=13325460&soccer=1 HTTP/1.1
而我的程序重定向到了:
GET /user_as/?receipt=13325460&soccer=1 HTTP/1.1
不知道为什么??

(对比过post的数据包,没有差别)

请达人解答,谢谢

...全文
815 10 打赏 收藏 转发到动态 举报
写回复
用AI写文章
10 条回复
切换为时间正序
请发表友善的回复…
发表回复
knowledge_Is_Life 2008-05-01
  • 打赏
  • 举报
回复
有问题请先GOOGLE,BAIDU
meiZiNick 2008-04-30
  • 打赏
  • 举报
回复
有问题请先GOOGLE,BAIDU
QSmile 2008-03-12
  • 打赏
  • 举报
回复
用 ICS 組件
linuxghs 2008-03-11
  • 打赏
  • 举报
回复
我用idhttp登录xiaonei.com的时候也遇到这个302了,好像修改了一个idhttp的属性就可以了。
僵哥 2008-02-19
  • 打赏
  • 举报
回复
    if (FHTTP.FHandleRedirects) and (FHTTP.FRedirectCount < FHTTP.FRedirectMax) then
begin
Result := wnGoToURL;
Request.URL := LLocation;
// GDG 21/11/2003. If it's a 303, we should do a get this time
// RLebeau 7/15/2004 - do a GET on 302 as well, as mentioned in RFC 2616
// RLebeau 1/11/2008 - turns out both situations are WRONG! RFCs 2068 an
// 2616 specifically state that changing the method to GET in response
// to 302 and 303 is errorneous. Indy 9 did it right by reusing the
// original method and source again and only changing the URL, so lets
// revert back to that same behavior!
{
if (LResponseCode = 302) or (LResponseCode = 303) then begin
Request.Source := nil;
Request.Method := Id_HTTPMethodGet;
end else begin
Request.Method := LMethod;
end;
}
Request.Method := LMethod;
end else begin
Result := wnJustExit;
Response.Location := LLocation;
end;
僵哥 2008-02-19
  • 打赏
  • 举报
回复
http://indy.fulgan.com/ZIP/
僵哥 2008-02-19
  • 打赏
  • 举报
回复
http://www.indyproject.org/docsite/html/frames.html?frmname=topic&frmfile=TIdHTTP_HandleRedirects.html

楼主不妨试一下新版的Indy10.
gunakid2 2007-10-24
  • 打赏
  • 举报
回复
哪位有解决方法??
gunakid2 2007-10-20
  • 打赏
  • 举报
回复
应该不是,我Post的数据包和我用IE浏览的数据一样,agent字段也一样,还有没其它的原因?
brightyang 2007-10-20
  • 打赏
  • 举报
回复
服务器是否关断了浏览器版本等

1,593

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 网络通信/分布式开发
社区管理员
  • 网络通信/分布式开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧