unit TestAuth; interface uses xmldom, XMLIntf, msxmldom, XMLDoc, Classes, SysUtils, Dialogs, LoggerImport, mybean.core.objects, InterfaceCA, IdHTTP, Forms; type TTestAuth = class(TMyBeanInterfacedObject, ICAClient) public function Request: string; stdcall; end; implementation uses CAImport, Windows, StrUtils, AppCentreImport, InterfaceAppCentre; { TTestAuth } function TTestAuth.Request: string; const GETUSER_URL: string = 'http://%s:%d/api/basic/GetUserByCA?appKey=%s&appSecret=%s&ca=%s'; var AID: string; AIdHttp: TIdHttp; AppCentreConfig: IAppCentreConfig; AURL: string; Str: string; begin AID := '1234567890'; Result := ''; AIdHttp := TIdHttp.Create(nil); try AppCentreConfig := GetAppCentreConfig; AURL := Format(GETUSER_URL, [AppCentreConfig.GetIP, AppCentreConfig.GetPort, AppCentreConfig.GetLxtAppKey, AppCentreConfig.GetLxtAppSecret, AID]); Result := Utf8ToAnsi(AIdHttp.Get(AURL)); // Result := Utf8ToAnsi(Str) finally FreeAndNil(AIdHttp); end; end; end.