我已经创建了我的类来使用REST.我在运行时遇到TRESTClient组件的问题.
TFrwWebServiceREST = class(TInterfacedObject, IRESTWebServiceProxy)
private
FClientRest: TRESTClient;
FRequestRest: TRESTRequest;
FResponseRest: TRESTResponse;
public
constructor Create (AUrl: string); virtual;
end;
...
constructor TFrwWebServiceREST.Create(AUrl: string);
begin
FClientRest := TRESTClient.Create (AUrl); //the error occurs here
FClientRest.AcceptEncoding := 'UTF-8';
FResponseRest := TRESTResponse.Create (nil);
FResponseRest.ContentEncoding := 'UTF-8';
FRequestRest := TRESTRequest.Create (nil);
FRequestRest.AcceptEncoding := 'UTF-8';
FRequestRest.Response := FResponseRest;
FRequestRest.Client := FClientRest;
end;
Run Code Online (Sandbox Code Playgroud)
错误并不总是发生...该过程完美地运行,然后一段时间后,此错误开始发生.
第一次机会异常,价格为7656C54F.已注册消息"没有带有guid {B8BD5BD8-C39D-4DF1-BB14-625FC86029DB的接口的对等体"的异常类EIPAbstractError'.
创建RESTClient时会引发异常.它能是什么?