Recent

Author Topic: THTTPSend and cache  (Read 2427 times)

cappe

  • Full Member
  • ***
  • Posts: 191
THTTPSend and cache
« on: September 11, 2017, 10:16:17 am »
Hi,

i use the THTTPSend command in order to get txt file from my site

procedure TForm1.Button1Click(Sender: TObject);
var URL: string;
    Params: string;
    Response: TMemoryStream;
    r:THTTPSend;
begin
   r:=THTTPSend.Create;
   URL:= ......
   r.HTTPMethod('GET',URL);
   Memo1.Lines.Add(r.ResultString);
   r.Free
end;

  the site returns each time a different value.
  the first download return the correct value, but the second time return return the previous value (cache value, I think) .

There is a way to clear the cache at each get request of Thttpsend?
 
« Last Edit: September 11, 2017, 11:10:23 am by cappe »

tudi_x

  • Hero Member
  • *****
  • Posts: 532
Re: THTTPSend and cache
« Reply #1 on: September 11, 2017, 10:57:39 am »
hi,
try releasing r. freeandnil(r).
Lazarus 2.0.2 64b on Debian LXDE 10

cappe

  • Full Member
  • ***
  • Posts: 191
Re: THTTPSend and cache
« Reply #2 on: September 11, 2017, 11:12:20 am »
hi,
try releasing r. freeandnil(r).

there was an error in the list above, there was already r.free.

But it does not work anyway

 

TinyPortal © 2005-2018