PDA

View Full Version : problem with HTTPCLI download


BaraoZemo
06-29-2011, 06:34 PM
Hi,

I use DELPHI 7 with this code for a long time with ICS7 without any problems... My code download a page using httpcli and save in my local disk.

but now ,after a fews months, the main site was updated and uses gzip-deflate and I think that this is the problem, I don't know how to
handle this, and my code stop working. please, need help urgent.....

download ICS7 package:
ICS7 package => http://www.overbyte.be/arch/OverbyteIcsV7.zip

download my full code (with sources and compiled exe).

http://www.fileden.com/files/2010/4/9/2822525/load-page-using-ICS7.zip

nester261
06-30-2011, 06:52 PM
I downloaded your code but didn't get anything other than a blank html document and no text in the Memo...

Now, what I have tried is using the Snapse library and it seems that the page wants to redirect. I also got the same results with Indy.

Here is the code I used and the response back from the website...

procedure TForm1.Button1Click(Sender: TObject);
var
HTTP: THTTPSend;
begin
HTTP := THTTPSend.Create;
try
HTTP.HTTPMethod('GET', Edit1.text);
Memo1.Lines.Assign(HTTP.Headers);
Memo2.Lines.LoadFromStream(HTTP.Document);
finally
HTTP.Free;
end;
end;

Response...

HTTP/1.1 302 Found
Location: http://www.caixa.gov.br/
Set-Cookie: security=true; path=/
Connection: close
Content-Length: 0
Content-Type: text/html; charset=UTF-8

BaraoZemo
06-30-2011, 08:31 PM
with the indy 10 (tiburon) , if you enable "cookies" (attach the cookies component to the idhttp, you will see the download working fine.. )
but I don't like use idhttp, because It freezes the application while downloading... and I got some memory leaks with indy so I don't use it.