Home > Back-end >  Memory problems after idhttp. Post method
Memory problems after idhttp. Post method

Time:10-09

Ask a question:
Debugging found when each time I perform IDHTTP. The post method, you will have a call TidSSLCipher didn't release the memory, how to handle this?

CodePudding user response:

Given the code you use, normally no such case,

CodePudding user response:

The HTML code is as follows, is called the great mall interface
Var
ResultStr: string;
SToken: string;
The begin
SToken:=FRMDM. GetAccessTokenByYun;
If the Trim (sToken)="' then the Exit;

HttpGet. Request. ContentType:='application/x - WWW - form - urlencoded';
Liststr. The Clear;

ListStr. Values [' dar] :=dar.

ResultStr:=DecodeUtf8Str (HttpGet. Post (' https://open.youzanyun.com/api/youzan.trade.get/4.0.0 '+ sToken, Liststr));
Result:=resultStr;
end;

CodePudding user response:

HttpGet created as follows:
HttpGet:=TIdHTTP. Create (nil);
HttpGet. HTTPOptions:=[];
HttpGet. AllowCookies:=False;
IdSSLIOHandlerSocket1:=TIdSSLIOHandlerSocket. Create (nil);
IdSSLIOHandlerSocket1. SSLOptions. Method:=sslvSSLv23;
HttpGet. IOHandler:=IdSSLIOHandlerSocket1;

Release is as follows:
HttpGet. IOHandler:=nil;
FreeAndNil (IdSSLIOHandlerSocket1);
FreeAndNil (HttpGet);
Inherited;
  • Related